WAVELET EEG DENOISING FOR AUTOMATIC ...

30 downloads 0 Views 187KB Size Report
1University of Texas at El Paso, Department of Electrical and Computer Engineering, El Paso TX, USA. 2 Universidad ... In a general sense, .... ge 4 and f) REM.
WAVELET EEG DENOISING FOR AUTOMATIC SLEEP STAGE CLASSIFICATION Edson Estrada1,2, Homer Nazeran1 Gustavo Sierra2 Farideh Ebrahimi3, Mohammad Mikaeili3 1 University of Texas at El Paso, Department of Electrical and Computer Engineering, El Paso TX, USA 2 Universidad Autónoma de Ciudad Juárez, Instituto de Ciencias Biomédicas, Cd. Juárez, Chih., México 3 Shahed University, Department of Biomedical Engineering, Tehran I R IRAN e-mail: [email protected] ABSTRACT EEG is a signal that is very easy to be contaminated with artifacts. In Automatic Sleep Stage Classification, Therefore, denoising and filtering the EEG is a crucial step that must be addressed before carrying out further analysis on the EEG signal. A novel solution to denoise non-stationary nature signals is based on the shrinkage of Discrete Wavelet Transform. In this paper we explored the waveletdenosing method on different sleep stages defined by the RK rules in order to find the best suitable threshold rule and threshold values. Results shown that Universal threshold value carried out better Minimum Squared Error (MSE) and signal-to-noise ratio (SNR) values when using a soft threshold filter on the detailed coefficients. Similar performances were observed on Stage 1, Stage 2, Stage 3, Stage 4 and REM stage signals. Moreover, this set of parameters can be applied to denoise EEG epochs from all depth stage of sleep. Key words: Wavelts, denoising, EEG, Automatic sleep stage classification.

1. INTRODUCTION EEG is a signal that is very easy to be contaminated with artifacts. The most common noise sources are EMG signal, electrode movements, 60 Hz power line interference and white noise. Some noise sources (e.g. white noise) are difficult to remove by typical bandpass finite impulse response (FIR) filters or infinite impulse response (IIR) filters techniques. For the reason that EEG Power Spectrum Density (PSD) overlaps with noise-source’s PSD makes almost unfeasible to take apart the desired EEG clean signal. For that reason, the effect of denoising EEG records has a direct influence on the quality of extracted features for automatic sleep stage classification. Therefore, denoising and filtering the EEG is a crucial step that must be addressed before carrying out further analysis on the EEG signal. In this paper we explored the wavelet-denosing method on EEG signals with brain rhythm corresponding to the different sleep stages defined by the RK rules [1]. (e.g. Awake, Stage 1, Stage 2 Stage 3, Stage 4 and REM) in order to find the best suitable threshold rule and threshold value. A novel solution to denoise non-stationary nature signals is based on the shrinkage of Discrete Wavelet Transform (DWT) coefficients, as proposed by Dohono et al. [2].

In order to deeply understand the fundaments on signal DWT denoising, this section will cover the mathematical roots and origins of this transform. A) DISCRETE WAVELET TRANSFORM In order to understand the basis of wavelets theory, let´s start on an extended Fourier Transform (FT) method known: Short Time Fourier Transform (STFT).The FT is a powerful tool to study the frequency content of a given signal; however, it lacks of information in time location which is crucial in non-stationary signal analysis. This issue is resolved by segmenting the original signal over a short period of time using a shifting window. Thus the STFT is computed as:

, = ∗  −     (1)

Where g(t-s) is the shifting window in time domain. In STFT analysis, the frequency resolution is fixed as a result of a fixed window utilization to split the signal. A Continuous Wavelet Transform (CWT) is method based on the STFT’s window-shifting process; CWT differs from STFT by also scaling the window or the self-styled “mother wavelet”. Thus the CWT is defined by equation:

,  =  ,  

(2)

Where

,  =

√

 #, 

"

$ ℝ& ,  $ ℝ

(3)

Here the ,  is the well-known wavelet window functions that are structure and based on the mother wavelet. Thus, the time resolution depends now on the scaling “a” parameter and the location parameter “b”. Several set of mother wavelets have been designed for wavelet transform analysis, the Mexican hat function, Harr, Symlet and Daubechies are only a few of them [3-5] The discrete transform of the CWT or DWT is achieved by taking discrete values of the parameters a and b.

'(,)  = *

(, +   * ( 

− -*  (4)

When a0 and b0 values are set to 2 and 1 respectively, the DWT can be described as the output produced by two quadratic mirror filters (QFT), where g is a highpass FIR filter and h is a lowpass FIR filter:

ℎ = −1 ) ℎ1 − -

(5)

Where h is related to the scaling function, whereas filter g is related to the mother wavelet.

01 = ∑) ℎ- √2 021 − -

1 = ∑) ℎ √2021 − -

(6) (7)

Thus the QMF outputs are characterized as:

45 = ∑) ℎ- − 26 1-

75 = ∑) - − 26 1-

(8) (9)

As it can be observed, x(n) is lowpass and highpass by h(n2L) and g(n-2L) convolution filters transforming the original signal in two subbands: [0-FN/2] and [FN/2-FN], Moreover, HL output is more commonly known as the Approximation component (A) and represents the lower resolution components. In this context, GL is known as the Detailed (D) decomposition containing the high resolution components. The DWT tree is form when the decomposition process is only applied on the A component of each corresponding level. During this process the time resolution is decreased by a factor of two in each level; however, the frequency resolution increases on each decomposed AL coefficients. The reconstruction of the signal is achieved by following the inverse procedure without loss of information. This technique is identified as the Inverse Discrete Wavelet Transform (IDWT) and differs from the DWT in the order that it implies upsampling and filtering the A and D subbands components The Wavelet Packet Transform (WPT) is calculated when the QMF filters are applied on both the approximate and the detail components. The WPT tree is a special case of the DWT and defines a neat set of filters which leads to a huge library of frequency subbands having an excellent resolution on the signal under the decomposition process. On the other hand, the cost of computing this filterbank has a high computational complexity of O(N(log(N)). B) DENOISING As stated before, EEG is a biosignal extremely easy to be contaminated with artifacts. In recent years, methods based on removing undesired wavelet coefficients, under the hypothesis that those coefficients are related to noise sources, are becoming very popular. In this method the signal is decomposed into its wavelet coefficients by applying the DWT, after selecting a pre-defined threshold value, coefficients that contribute to noise components are discriminated and zero out by using a threshold discrimination filter (Figure 1). B.1) Threshold filter The coefficients 89 are modified according to a threshold value λ and a threshold coefficient filter. In a general sense, the wavelet denoising method is based on the absolute value of89 , smaller 89 are considered noise, whereas larger values are considered as coefficients that contribute to the signal information rather than the noise information. A hard-thresholding rule is defined as follow:

0

=89 = < ?

A(10) ; ^9 ^9 8 =8 = ≥ ? ^9 Where 8 is the detailed coefficient wavelet k at a level l. 8^9

An alternative shrinkage function, the soft-thresholding rule is defined by:

0

=89 = < ?

A(11) ; ^9 ^9 ^9 -8  8

=8 = ≥ ? Where -8^9 is the mathematical sign function.

8^9

Hard thresholding is preferred to reproduced signal with discontinuities or abrupt changes; however, this method produces artifacts on the reconstructed signal due to the discontinuity filtering nature. This issue is overseen by the soft-thresholding method but the main disadvantage is that the coefficients are shrunk toward the zero and consequently the reconstructed signal will possess lower amplitude than the original signal amplitude[4]. B.2) Threshold value λ There are diverse methods to determine the threshold value λ [6]. One of the most commonly used is the Universal threshold value which depends on the amount of samples N on the signal.

λ = C2log N

(13)

λ = CNVk JKL

(14)

The method known as SURE (Stein’s Unbiased Risk Estimation) is calculated by minimizing the risk function:

Where NV(k) is a data vector to the second power.

MN =

O+8&∑R STU OP &OQ OPOQ

)

(15)

The Heuristic SURE selects the lowest value of the two previous thresholds. The last threshold method discussed in this work is the Minimax, here λ value is defined as a data series as follow: \]^_

λ = 0.3936 + 0.1829`]^+

(16)

2. METHODS A) DATA

Data were available on the Physionet website for downloading on EDF format [6]. The 10-20 Standard electrode placement system was used for EEG recording. Polysomnograms were obtained using the Jaeger-Toennies system. Signals recorded were: EEG (C3-A2), EEG (C4-A1), left EOG, right EOG, submental EMG, ECG (modified lead V2), oro-nasal airflow (thermistor), ribcage movements, abdomen movements (uncalibrated strain gauges), oxygen saturation (finger pulse oximeter), snoring (tracheal microphone) and body position. A sample rate of 128 Hz was used for EEG, EOG and ECG tracing, whereas EMG was sampled at 32 Hz . Each epoch was analyzed for the num-

ber of apneas, hypopneas, EEG arousals, oxyhemoglobin desaturation, and disturbances in cardiac rate and rhythm.

€M = 10fg ∑

∑„ ‚zƒ )

 z ) ƒ „~‚) ‚

(22)

3. RESULTS B) NOISY SIGNAL CONSTRUCTION One EEG from each sleep stage was selected (Figure 1) to create y(n) EEG noisy signals by adding a white noise signal (E[x]=0, a = 20 and a 50 Hz powerline sinusoidal noise as follow:

b- = 1- + - + -

(17)

C) FILTERING AND DENOISING EEG EPOCHS The first step to clear y(n) was to eliminate the s(n) by applying a WPT decomposition and zeroing out the WPT coefficients of that EEG’s subbands where no brain’s rhythm content is supposed to be present (0 to 0.5 Hz and frequencies above 40 Hz). According to the Naquist theorem, the maximum frequency contained in the EEG signal is 64Hz for a sample frequency of 128 Hz (FN=64 Hz). To achieve a resolution of 0.5Hz on each subbands, the number of levels required was computed as follow: 1. The number of subbands required are: cde-f -g =

hi

hjklmk)no pkqr9msr)

=

tuvw

*.xvw

= 128 (18)

2. The number of terminal nodes is double each level of decomposition

cde-f -g = 29

(19)

128 = 2y

(20)

A total of 8 different combinations of threshold values methods and threshold rules were computed on each EEG epoch, leading to a total of 64 experiments. Table 1 summarizes the MSE and SNR criteria of each combination. Moreover smaller MSE and larger SNR values indicated a better denoised and filter signal and more close to original x(n). For awake stage it can be observed that the threshold soft rule performed better that the hard threshold rule; however, if a hard threshold rule still desired over soft rules then SURE or Heuristic SURE Rules are the best threshold value options. Universal threshold value carried out better MSE and SNR values when using a soft threshold filter on the detailed coefficients. Similar performances can be observed on Stage 1, Stage 2, Stage 3, Stage 4 and REM stage signals.

4. CONCLUSIONS We can conclude that the best combination of threshold rule filter and threshold is based on soft thresholding and Universal threshold lamda value. Moreover, this set of parameters can be applied to denoise EEG epochs from all depth stage of sleep. Even though this may be seen as a straightforward decision; the results shown that no matter the EEG rhythm content, the denoising performance will be always the best possible achieved. Furthemore, there is no need of an adaptive denoising method based on depth of sleep.

5. REFERENCES

3. Thus the number of levels required is 7

Therefore, a WPT Dauchabies of second order (db2) and 7 levels was used to decomposed the EEG signal and create this needed filterbank. After bandpassing the non desired frequency content by zeroing out the proper terminal node coefficients, the signal was reconstructed using the Inverse Wavelet Packet Transform (IWPT). Then the EEG was decomposed again using a DWT Dauchabies of second order (db2) and 7 levels. After that, the hard-threshold and soft-threshold rules were applied on the EEG bandpassed noisy record and the threshold value λ was computed by Universal, SURE threshold, Heuristic SURE and Minmax methods. The criteria utilize to evaluate denoise performance were the mean square error (MSE) value and Signal to Noise Ratio (SNR) value between the constructed de-noised EEG signal 1z (n) and the original EEG x(n) signal as follow: and,

{| = O ∑O z - + s} ~1- − 1

(21)

[1] Rechtschaffen A. Kales A. Rechtschaffen A. Kales A, eds. “A Manual of standardized terminology, techniques and scoring system for sleep stages of human subjects. Los Angeles: Brain Information service/Brain Research Institute, 1968 [2] Donoho, D.L. "Progress in wavelet analysis and WVD: a ten minute tour," in Progress in wavelet analysis and applications, Y. Meyer, S. Roques, pp. 109-128. Frontières Ed, 1993. [3] Daubechies, I, “Ten Lectures on Wavelets” (CBMSNSF Regional Conference Series in applied Mathematics), SIAM, 1992. [4] Guarnizo Lemus, C., “Análisis de reducción de ruido en señales EEG orientado al reconocimiento de patrones” Revista Tecnológicas No. 21, diciembre de 2008 [5] Edgar Oropesa, Hans L.Cycon, Marc Jobert, “Sleep Stage Classification using Wavelet Transform and Neural Network”, International Computer Science Institute ( ICSI), 1999 [6] Physionet at http://www.physionet.org/

c)

d)

e)

f)

Figure 1. EEG Epochs. a)Awake, b) Stage 1, c)Stage 2,, d) Stage 3, e) Stage 4 and f) REM

Table 1. Denoise performance criteria

Stage Awake Stage 1 Stage 2 Stage 3 Stage 4 REM

MSE SNR MSE SNR MSE SNR MSE SNR MSE SNR MSE SNR

SURE 68.134 3.6 68.361 3.7904

Soft Thresolding Heuristic Sure Universal Minimax 68.134 55.291 58.71 3.6 4.507 4.2465 68.361 56.158 59.308 3.7904 4.6444 4.4073

SURE 68.585 3.5713 68.672 3.7707

Hard Thresholding Heuristic Sure Universal Minimax 68.585 68.958 68.796 3.5713 3.5478 3.558 68.672 69.159 68.806 3.7707 3.74 3.7622

68.217 10.256 68.164 11.49

68.178 10.258 68.164 11.49

56.803 11.051 55.368 12.393

59.474 10.851 58.648 12.143

68.657 10.228 68.733 11.454

68.648 10.228 68.733 11.454

68.801 10.219 68.856 11.446

68.661 10.228 68.615 11.462

69.83 10.534 67.916 9.3408

69.065 10.582 67.916 9.3408

57.261 11.396 55.833 10.192

59.937 11.197 59.001 9.9519

69.033 10.584 68.568 9.2993

68.996 10.586 68.568 9.2993

68.681 10.606 68.696 9.2911

68.886 10.593 68.742 9.2882