Lossless Multi-channel EEG Compression Yodchanan Wongsawat† , Soontorn Oraintara† , Toshihisa Tanaka‡ and K. R. Rao† †
‡
Department of Electrical Engineering, University of Texas at Arlington, Department of Electrical and Electronic Engineering, Tokyo University of Agriculture and Technology, and RIKEN Brain Science Institute Email:
[email protected],
[email protected],
[email protected] and
[email protected]
Abstract— This paper presents a method for losslessly compressing multi-channel electroencephalogram signals. The Karhunen-Loeve transform is used to exploit the inter-correlation among the EEG channels. The transform is approximated using lifting scheme which results in a reversible realization under finite precision processing. An integer time-frequency transform is applied to further minimize the temporal redundancy.
VEOL
VEOU
AF7
I. I NTRODUCTION Nowadays, electroencephalogram (EEG) has become one of the useful signals for clinical analysis, i.e. to diagnose the disease and to assess the effectiveness of the treatment via the brain functions. However, this analysis process normally takes a very long period of time. Taking into account that, every sample of EEG signals is very important and cannot be neglected without the consideration by a few experts, therefore, legal storage of these long-term EEG signals for further analysis has to be done losslessly. In order to compress EEG signals, several types of redundancies must be taken into account. The temporal redundancy is successfully removed in [1], [2]. Antoniol et al presented the survey on EEG lossless compression algorithms using predictive coding, transform coding, vector quantization together with the entropy coding and compared with some well known lossless compression algorithms [3], [12]. The improved version of [1] on predictive coding using AR model of order 6 with bias cancellation and conditional coding is proposed in [2]. EEG signals are simply measured from different electrode positions on human scalp as shown in Fig. 1. Therefore, the neighboring channels of EEG signals usually have a high degree of similarity in their structures. In order to efficiently compress the multi-channel data, this inter-channel redundancy must be exploited. Although, these multi-channel signals are visually correlated, the correlation models of the signals are unpredictable. Hence, data independent transforms such as DCT, DST, or DFT [4] usually fail to efficiently decorrelate them. This problem can be solved by employing an optimal transform that can decorrelate the signals by finding the eigenvectors of their correlation matrix. This optimal transform is known as KarhunenLoeve transform (KLT) [4]. An efficient algorithm employing KLT to decorrelate the inter-channel redundancy of multi-channel signals has been applied to audio coding in [5]. In practice, the KLT is simply truncated yielding a non-reversible process. In this paper, a lossless compression algorithm for multi-channel EEG signals exploiting an integer-to-integer mapping approximation of KLT is presented. Using the factorization in [8], KLT is further parameterized by a ladder factorization, rendering a reversible structure under quantization of coefficients called IntKLT. It should be noted that the choice of selecting the permutation matrices for the factorization is important to the lossless coding applications. Since, the factorization of the KLT is not unique, each solution results in a different permutation and dynamic range of coefficients. Thus, finding the best solution in the sense of minimum dynamic range
0-7803-9390-2/06/$20.00 ©2006 IEEE
FP1
HEOL
FPZ
AF3
FP2
GND
HEOR
AF4
AF8
F7
F5
F3
F1
FZ
F2
F4
F6
F8
FT7
FC5
FC3
FC1
FCZ
FC2
FC4
FC6
FT8
T7
C5
C3
C1
CZ
C2
C4
C6
T8
TP7
CP5
CP3
CP1
CPZ
CP2
CP4
CP^
TP8
P7
P5
P3
P1
PZ
P2
P4
P6
P8
PO7
PO5
PO3
POZ
PO4
PO6
PO8
O1
OZ
O2
M1
M2
Fig. 1.
N -channel EEG
of coefficients is very difficult. An obvious approach is to compare all the possible factorizations which minimize the ladder coefficients. This, however, is impractical for a large scale N × N matrix since the number of solutions is of order O(N !). In order to minimize the ladder coefficients while maintaining the acceptable complexity, pivoting is also suggested. II. P ROPOSED CODER In this section, the lossless coder for multi-channel EEG is presented. Fig. 2 shows the block diagram of the coder consisting of four components: differential pulse code modulation (DPCM), IntKLT, IntDCT and Huffman coder. Multi-channel EEG Signals
Temporal DPCM
Fig. 2.
Inter-channel Decorrelation (IntKLT)
Time-frequency Transform (Stereo-IntDCT)
Entropy Coding (Huffman)
Bit stream
Block diagram of the proposed lossless coder
A. DPCM According to the data acquisition stage, the strength of electrical activity at different electrode positions on the scalp is varied. Fig. 6(a) shows four EEG waveforms measured at different locations. It is observed that, while sharing some temporal similarity, they have different DC-bias. This bias complicates and degrades the inter-channel decorrelation performance. Thus, simple lossless DPCM (backward difference) is applied: yi [n] = xi [n] − xi [n − 1]. This process results in zero-mean multi-channel signals as shown in Fig. 6(b).
1611
ISCAS 2006
B. Spatial Decorrelation
-1 DCT IV
In general, the inter-channel correlation of EEG signals is inconsistent. Fixed transforms such as DCT and DFT fail to efficiently exploit their relationship. Hence, at this stage, a data-dependent type of transforms is preferred. Let T be a transform for the multi-channel signals, i.e. y[n] = Tx[n], T
and y[n] = where x[n] = [x0 [n], . . . , xN−1 [n]] [y0 [n], . . . , yN−1 [n]]T are input and output vectors for the transformation. Two types of T are considered in this paper: multichannel-linear prediction in Fig. 3 and the KLT whose factorization is in Fig. 5. The first approach corresponds to a triangular matrix T where the coefficients sk are optimized to minimize the mean square error of prediction. The second corresponds to an orthogonal matrix T, which diagonalizes the x[n]x[n]T . By using the parameterizations correlation matrix N1 n in Figures 3 and 5, lossless compression can be achieved by reversible lifting operations [6]. Figure 6(c) shows an example of outputs after using IntKLT for spatial decorrelation.
s1
[ ]
[ ]
DCT IV
DCT IV
[ ]
+
DCT IV
Fig. 4.
+
Ladder structure of stereo IntDCT-IV
where PL is a permutation matrix, Si are single-row non-zero offdiagonal matrices for i = 0, 1, . . ., N . The diagonal elements of Si are ±1. Thus, A can be approximated with reversibility preserved by simply quantizing the off-diagonal of Si . However, this approach suffers from the unpredictable dynamic range of these elements which has a direct impact in the dynamic range of the internal node of the structure and the lossless coding performance. In [9], a modification for reducing this dynamic range is proposed by simply adding a condition on how the permutation matrix PL in (1) is selected. This modification results in a similar factorization to (1) except that S0 is now a lower-triangular matrix. In this paper, a modification to [9] is proposed in order to further reduce the dynamic range of the coefficients. It takes into account that the input signals can be pre-ordered without loosing any information, Thus, another permutation matrix PR is incorporated to (1) AN×N = PL SN SN−1 · · · S1 S0 PR .
+ + s5
Even KLT Channels
DCT IV
[ ]
(2)
s3
[ ] s4
~ ~
Even KLT Channels
+ s2
Odd KLT Channels
Odd KLT Channels
s6
+ [ ] +
Fig. 3. Example for the 4-channel case of the structure of linear prediction used for inter-channel decorrelation
In the proposed coder, the KLT matrix is parameterized using (2). To obtain a reversible approximation, a rounding operator is introduced at each ladder stage, resulting in the IntKLT. Fig. 5 shows an example of the proposed IntKLT for the case of N = 4. As one can see, there are a total of 32 N (N − 1) coefficient and only 2N − 1 rounding operations. Fig. 7 shows improvement in accuracy of the IntKLT using the proposed factorization in (2) compared to that in [9]. It is evident that the rounding error is approximately reduced by 5%.
C. Temporal Decorrelation
23
After spatial decorrelation, residual temporal redundancy is exploited in each output. Considerations for the choice of transform in this process include: 1) it provides a reasonable time-frequency representation, 2) it is a reversible process, and 3) it can be computed at low cost. In this paper, the stereo IntDCT-IV proposed in [7] depicted in Fig. 4 is employed. Fig. 6(d) shows an example of the outputs from the stereo IntDCT where the signals are divided into blocks of 1024 samples.
22
Propose Galli
21 20 19 18 17 16 15
D. Entropy Coding Huffman coding is used in this research for two main reasons: 1) to further losslessly reduce the statistical redundancy, and 2) to fairly compare the coding results with other lossless algorithms. It may be observed that more sophisticated entropy coding can also be applied in order to achieve the better coding performance.
14 13 40
45
50
55
60
Fig. 7. Cumulative mean absolute error of the proposed algorithm and Galli’s algorithm for 64 channel IntKLT using 8,192 samples of EEG signals, where x-axis represents the number of cumulated channels and y-axis represents cumulative mean absolute values
III. S OME I SSUES ON I NT KLT This section describes a realization of the IntKLT used in the proposed coder. According to [8], any N × N non-singular matrix with determinant of one can be factorized as AN×N = PL SN SN−1 · · · S1 S0 ,
(1)
IV. S IMULATION RESULTS In the simulation, eight seconds of sixty-four channels of EEG signals sampled at 1.024 kHz and digitized to sixteen bits are used. The lossless coder described in Section II is applied to the EEG
1612
+ s01
[]
+
+ s11
+ s02
s21
[]
s12
s22
s13
[]
s23
+
s03
+
PR
PL
[] +
s06
s31
s41
s32
s42
s43
+
+ +
+
[]
s05
[]
s04
[]
s33
+
+
S1
S0
Fig. 5.
S2
S3
S4
Example of the structure of factorization for the case of 4 × 4 matrix
4
2
x 10
2000
0 0
−2
0
1000
2000
3000
4000
5000
6000
7000
8000
−2000
4
2
x 10
0 −2
0
1000
2000
3000
4000
5000
6000
7000
8000
x 10
−2000
2000
3000
4000
5000
6000
7000
8000
0
1000
2000
3000
4000
5000
6000
7000
8000
0
1000
2000
3000
4000
5000
6000
7000
8000
0
1000
2000
3000
4000
5000
6000
7000
8000
2000
0 −2
1000
0
4
2
0
2000
0
0
1000
2000
3000
4000
5000
6000
7000
8000
−2000
4
2
x 10
2000 0
0 −2
0
1000
2000
3000
4000
5000
6000
7000
8000
−2000
(a)
(b)
2000
2000
0
0
−2000
0
1000
2000
3000
4000
5000
6000
7000
8000
−2000
2000
2000
0
0
−2000
0
1000
2000
3000
4000
5000
6000
7000
8000
−2000
2000
2000
0
0
−2000
0
1000
2000
3000
4000
5000
6000
7000
8000
2000
−2000
0
1000
2000
3000
4000
5000
6000
7000
8000
0
1000
2000
3000
4000
5000
6000
7000
8000
0
1000
2000
3000
4000
5000
6000
7000
8000
0
1000
2000
3000
4000
5000
6000
7000
8000
2000
0
0
−2000
−2000
0
1000
2000
3000
4000
5000
6000
7000
8000
(c)
(d)
Fig. 6. (a) Raw EEG signals selected from channel FP2, FPZ, FP1 and AF7, according to Fig. 1, (b) Temporal domain DPCM of 4-channel EEG, (c) KLT channel of 4-channel EEG signals, (d) 4-channel EEG signals after decorrelating in the temporal domain, where x-axis represents the number of samples and y-axis represents the transform coefficients .
data. Table I illustrates the compression performance as various interchannel decorrelation schemes are used. These coding results in Table I are done without using the time-frequency transform block in Fig. 2. A maximum ratio of 2.38 is obtained by using the IntKLT trained from 8-second 64-channel EEG signals while the IntDCT [11] and linear prediction (Fig. 3) yield 2.11 and 2.20 in compression ratio. Table II compares coding results obtained from the full coder
described in Fig. 2 with different temporal decorrelation methods. In this test, the DPCM and the IntKLT are used at the previous two stages. Compression ratio of 2.71 and 2.77 are achieved when the 6-th order autoregressive filter [2] and the stereo IntDCT-IV [7] are used, respectively. Table III shows the contribution of each block diagram in Fig. 2 and their possible combinations in terms of compression ratios of
1613
TABLE I C OMPRESSION PERFORMANCES OF DIFFERENT INTER - CHANNEL DECORRELATION METHODS IN THE 64- CHANNEL EEG LOSSLESS COMPRESSION SYSTEM : C OMPRESSION PERCENTAGE IS DEFINED AS (16 − output bit rate) × 100/16 Channel decorrelation
Compression percentage
Compression ratio
Bit per sample
IntDCT
52.56
2.11
7.59
Linear prediction
54.5
2.20
7.28
IntKLT
58.0
2.38
6.72
TABLE IV E NCODING 16 BIT PER SAMPLE ( BPS ) OF 64- CHANNEL EEG SIGNALS WITH VARIOUS LOSSLESS CODING ALGORITHMS (P ROPOSED CODER IS ENCODED USING H UFFMAN CODING WITH OPTIMAL CODEBOOKS ) 64 channels 16 bps
Proposed
Shorten
JPEG2000
GZIP
Compression Percentage
64.81
53.75
49.33
30.56
Compression Ratio
2.84
2.16
1.97
1.44
Bits per sample
5.63
7.4
8.11
11.11
V. C ONCLUSIONS TABLE II A COMPARISON BETWEEN LINEAR PREDICTION AND I NT DCT IN DC- BIAS REMOVAL , AND I NT KLT IS USED FOR INTER - CHANNEL DECORRELATION )
TEMPORAL DECORRELATION (DPCM IS USED FOR
Temporal decorrelation
Compression percentage
Compression ratio
Bit per sample
AR(6)
63.19
2.71
5.89
IntDCT-IV
63.88
2.77
5.78
the overall system. Performing all redundancy reduction schemes (DPCM, IntKLT and IntDCT-IV) leads to the best coding compression ratio of 2.77. Table IV compares the performance of our proposed lossless coding algorithm with GZIP [12], optimal linear prediction based lossless coding (Shorten) [13], and lossless JPEG2000 [14]. According to Table IV, the proposed coder yields a compression ratio at 2.84 while the Shorten, losslessJPEG2000 and GZIP yield compression ratios of 2.16, 1.97 and 1.44, respectively. However, the existing coders in Table IV are still dominated the proposed coder in the time complexity aspect, since our coder employs KLT. Although, the computational complexity of the proposed coder is highly consumed in the process of spatial decorrelation by calculating the eigenvalues and eigenvectors of KLT and by factorizing KLT matrix to form its reversible structure, this complex stage leads to very simple and effective temporal decorrelation (stereo IntDCT-IV) and entropy coding (Huffman). It should be noted that, in this test, different Huffman codebooks are used for high activity samples and smooth samples whereas a single Huffman codebook is used in all previous tests. TABLE III P ERFORMANCE OF THE 64- CHANNEL EEG LOSSLESS COMPRESSION SYSTEM USING VARIOUS DECORRELATION SCHEMES FOLLOWED BY
H UFFMAN CODING DPCM
IntKLT
IntDCT-IV
Compression ratio
No
No
No
1.34
Yes
No
No
2.06
No
Yes
No
1.92
No
No
Yes
1.90
Yes
Yes
No
2.38
No
Yes
Yes
2.45
Yes
No
Yes
2.49
Yes
Yes
Yes
2.77
In this paper, we have presented the lossless compression scheme that is efficient for coding the multi-channel EEG signals. The proposed lossless coder efficiently removes DC-bias occurring from EEG data acquisition stage using DPCM. Inter-channel correlation can also efficiently be reduced by using IntKLT. The dynamic range of the ladder coefficients for implementing IntKLT is reduced by the suggested pivoting scheme. Temporal redundancy is simply but well decorrelated using IntDCT-IV. Furthermore, the proposed lossless multi-channel EEG compression scheme can obviously improve coding performance over the existing lossless algorithms by carefully taking the inter-channel redundancy of EEG signal into consideration. Finally, more works on reducing computational complexity in interchannel decorrelation using KLT process need to be investigated for the purpose of real time transmission of multi-channel EEG signals. VI. ACKNOWLEDGEMENT The authors would like to thank RIKEN Brain Science Institute for providing the multi-channel EEG data for the experiments. Soontorn Oraintara was supported in part by NSF Grant ECS-0528964. R EFERENCES [1] G. Antoniol and P. Tonella, “EEG data compression techniques,” IEEE Trans. Biomed. Eng., vol.44, pp.105-114, Feb. 1997. [2] N. Memon, X. Kong, and J. Cinkler “Context-based lossless and nearlossless compression of EEG signals,” IEEE Trans. Biomed. Eng., vol.3, pp.231-238, Sep. 1999. [3] K. R. Rao and J. J. Hwang, Techniques and Standards for Image, Video, and Audio Coding, Upper Saddle River: Prentice Hall, 1996. [4] K. R. Rao and P. C. Yip, The Transform and Data Compression Handbook, Boca Raton: CRC Press, 2001. [5] D. Yang, H. Ai, C. Kyriakakis and C.-C. J. Kuo “High-fidelity multichannel audio coding with Karhunen-Loeve transform,” IEEE Trans. Speech and Audio Processing, vol.11, pp.365-380, July 2003. [6] W. Sweldens, “Lifting scheme: A custom-design construction of biorthogonal wavelets,” Applied and Computational Harmonic Analysis, vol.3, pp.186-200, Apr. 1996. [7] Y. Yokotani, R. Geiger, G. Schuller, S. Oraintara and K. R. Rao, “Lossless Audio Coding Using the IntMDCT and Rounding Noise Shaping,” Accepted for publication in IEEE Transactions on Speech and Audio Processing, October 2005. [8] P. Hao and Q. Shi, “Matrix factorizations for reversible integer mapping,” IEEE Trans. Signal Processing, vol.49, pp.2314-2324, Oct. 2001. [9] L. Galli and S. Salzo “Lossless hyperspectral compression using KLT,” IEEE IGARSS, vol.1, pp.313-316, Sept. 2004. [10] P. Hao and Q. Shi, “Reversible integer KLT for progressive-to-lossless compression of multiple component images,” IEEE ICIP, vol.1, pp.633636, Sept. 2003. [11] Y. J. Chen, S. Oraintara, T. Tran, K. Amaratunga, T. Q. Nguyen, “Multiplierless approximation of transforms with adder constraint,” IEEE Signal Processing Letters, Vol.9, pp.344-347, Nov. 2002. [12] Available GZIP software: http://www.gzip.org/ [13] Available Shorten software: http://www.etree.org/shncom.html/ [14] Available JPEG2000 software: http://www.kakadusoftware.com/
1614