EEL5934 BioSignals Processing



|Florida Atlantic University |

|EEL5934 BioSignals Processing |

|EEG Signal Processing – Seizure Detection |

| |

|By: |

|Wilfredo Rivas-Torres |

|Roxana Melendez |

|Professor: Dr. Erdol |

| |

Table of Contents

0bjective: 3

Analysis Outline: 3

Part 1: Analysis using fixed frame length spectrogram 4

Comments on the results: 9

Part 2: AR Filter Order Estimate 10

Comments: 11

Part 3: Spectral Error Measure using the Whitening method 12

Comments on the results: 17

Part 4. Wigner-Ville distribution spectrogram 18

Comments on the results: 19

Appendix A: Fixed Frame Spectrogram Matlab Code 20

Appendix B: AR Filter Order Study Code 21

Appendix C: SEM Fixed Frame Method Code 22

Appendix D: Wigner-Ville Distribution Code 25

References: 31

0bjective:

The objective of this project is to develop code for the analysis of EEG (electro-encephalogram) signals for the detection of the onset and end time of epileptic seizures.

Introduction:

The EEG signals are commonly recorded using the 10/20 standardize system for electrode locations. The recorded EEG signals have amplitudes that vary from a few µV to approximately 100 µV and a frequency range from 0.5 Hz to 40 Hz. While there is some level of debate as to whether the EEG signals exhibit stochastic or deterministic characteristics, our approach is to consider them a stochastic signals.

Analysis Outline:

The following analyses are performed as part of this report, more details are provided in each section.

1. Fixed frame length spectrogram

2. AR filter order estimate via filter order swept analysis

3. Spectral Error Measure using the Whitening method

4. Wigner-Ville distribution spectrogram

Physionet data used:

The following summarizes the data used in the analyses which was obtained at .

|File Name |chb02_15.edf |chb02_16+.edf |chb12_24.edf |chb12_23.edf |

|Start Time |8:31:38 |10:50:23 |13:06:45 |12:06:43 |

|End Time |9:31:38 |11:50:23 |14:06:45 |13:06:43 |

|Seizure 1 |None |Start: 2972 s |None |Start: 253 s |

| | |End: 3053 s | |End: 333 s |

|Seizure 2 |  |  |  |Start: 425 s |

| | | | |End: 522 s |

|Seizure 3 |  |  |  |Start: 630 s |

| | | | |End: 670 s |

Table 1: Physionet Data Records Analyzed

Notice that we have selected two records that include seizures and two records that do not include seizure. There are only two patients considered; which are identified as chb02 and chb12.

Part 1: Analysis using fixed frame length spectrogram

The concept behind the fixed frame length spectrogram is to observe the PSD (power spectral density) versus time. This type of analysis provides information not only of the spectral content of the EEG signal, it also provides when in time the different spectral components of the signal occur. This type of analysis is thought to show both the conditions for the onset and subsequent seizure events. This is possible because the PSD of the EEG signal is thought to change during a seizure event.

The Matlab code used to perform this analysis is shown in Appendix A. The code has a user input section of which the frame duration (tframe) and the frame overlap percentage (overlap) are of special interest in this report. The code is run for default values of tframe=10 sec and overlap=80%.

Comments:

1. The decimation factor (dec) was set to three (3). The PSD therefore includes frequencies up to 46.67 Hz (sr/2/dec) which covers the frequencies of interest in EEG signals.

2. The frame length was set to 10 seconds; this works well because the seizure events reported in the data all lasted more than 10 seconds with the shortest duration being 40 seconds.

3. The FP1-F7 signal was selected from the Physionet records to be studied in this part of the project.

Results:

File:chb_02_15.edf

[pic]

[pic]

[pic]

File:chb_12_24.edf

[pic]

[pic]

[pic]

File:chb_02_16+.edf

[pic]

[pic]

[pic]

File:chb_12_23.edf

[pic]

[pic]

[pic]

Comments on the results:

1. The results for chb02_15.edf and chb12_24.edf (non-seizure) record show some areas with a broadband response (such as that pointed by the blue arrows in the chb02_15.edf results). The following charts show the EEG signal just before the blue arrow location (440 to 450 s) and the location near where the arrow points to (460 to 470 s):

[pic]

[pic]

Notice that in the lower time frame shown the signal is in fact higher amplitude and higher frequency. The origin of this high frequency could be related to artifacts related to other physiological events that got picked up by the EEG electrodes but this is just a conjecture.

2. The spectrogram for the chb02_16+.edf file has frequency components at close to 4 Hz and its harmonics (up to the 9th harmonic). This is an outstanding feature since it happens before the seizure that actually is reported on Physionet to start at 2972 s, in the record but these extraneous frequencies “disappear” around 2700 s, which is more than 4 minutes before the seizure is reported to start. Remarkably there is no observable special feature during the seizure that can easily be observed on this spectrogram.

3. The ch12_23.edf spectrogram showa only some weak 16 Hz and 32 Hz signal in the early portion of the records that are visible. This is remarkable because for this record the 3 seizures occurred early in the record (between 253 s and 670 s) and the expectations were that some event would be recorded in the EEG signals.

4. There is no appreciable difference between the two windows used in the spectrograms, namely Hamming and Gaussian. In the rest of this report we use the Hamming window.

5. The spectrogram technique could be used to detect the “onset” of epileptic seizure events using the FP1-F7 signal based on our results mentioned in #2. However this is a conjecture based on a single sample. It would be interesting to research this further, including looking at other EEG signals and records to get a firm grasp if this is a clear tendency.

Part 2: AR Filter Order Estimate

In part 3 of this project autoregressive (AR) modeling will be used. The model parameters can be estimated using the aryule() or arburg() functions in Matlab. These functions also provides the model prediction error which is to be as low as possible. In practice after a certain order the reduction in error is negligible and may even increase (i.e. after certain orders there are diminishing returns). The question is what is the correct order? In order to study this in the EEG framework the chb02_15.edf record will be used. The intention is to sweep the order and record the prediction variance versus filter order.

The Matlab code used to plot the AR model variance versus filter order is included in Appendix B. The results of this analysis are shown on the next page.

[pic]

Comments:

Notice that for orders greater than 20 (see data marked on the plot) the variance does not change much. This gives a reasonable value for setting the AR filter order to use in the analyses. In an abundance of extra caution and because only one record was studied the order will be set at 50 for the rest of this project. The aryule() function will was also selected since it provide the least intense computing resources even though the Burg AR modeling method provides smaller variance. If the computing resources were not an issue then arburg() could be the preferred option if it can be proven that it provides a better spectrum representation of the original data than aryule().

Part 3: Spectral Error Measure using the Whitening method

In this part of the project techniques that divide the EEG signal into segments of similar spectral characteristics are explored. The basis of these methods can be found in reference [1] chapter 3. The basic idea behind this method is to find a quantitative and compact method to describe the entire EEG record. Of particular interest are brief physiological events that occur in the signal that may be overlooked. This method requires a reference and a test window. An estimate of the error in the reference is obtained and compared to the error estimate in the test window. A “dissimilarity measure” between the two windows is then computed and the test window slides to the next frame. The methodology uses a variable frame boundary for the test signal, i.e. during the dissimilarity measure the test frame is increase and compared to the reference frame until a threshold (η) is exceeded.

The algorithm described above is in fact searching for an indicator of non-stationary behavior as indicated in reference [2]. Segment boundaries also need to take into consideration (see ref.[1] pp. 127) that any activity remain stationary for at least one second and the change in the signal statistics needs to be abrupt in order to detect a change. These requirements clearly put significant pressure on the developer to come up with a clear criterion as to the boundaries of the different segments. For example see Figure 3.26 of reference [1], it clearly shows that the measure of dissimilarity can cross the threshold (η) but because it is not an abrupt change it does not trigger a new segment boundary.

In this report a variation to the method describe in reference [1] (section 3.5.2) is proposed and tested. The proposed method starts by observing Figure 3.26 of reference [1], here a reference window is reset each time the signal crosses the threshold in a abrupt fashion and is of a constant length. It is not clear how the length of this window is established or how the validity of any reference frame was established (i.e. stationarity). In order to resolve the reference window issue a record from a patient in which no seizure was report will be used as the baseline to establish the reference frame. The idea behind this is the posteriori knowledge that no seizure occurred during the reference frame since this record does not contain any seizures. Furthermore the method will explore a variable reference frame, the idea being that if a maximum frame length is reach the frame can be established in confidence since non-stationary effects were not detected within this frame. In the event that an abrupt dissimilarity is detected the reference frame length is limited to this length of time. The method is applied per patient so there will be one reference frame per patient.

The Spectral Error Measure (SEM) fixed frame method is based on the parametric estimation of AR (autoregressive) power spectra (see Firure 3.27 reference [1]). Once a spectral change occurs in the nth frame, the output of the AR filter is no longer a white process. Assuming that the order of the AR filter has been chosen appropriately (see part 2 of this report) to describe the reference window, the prediction error variance [pic] can be estimated using the aryule() function in Matlab. Using this error variance the quadratic spectral error measure [pic] is defined as:

[pic]

The new method uses this SEM measure for each fixed frame length of the test record. Based on the average and standard deviation of the SEM color coded graphs of the traces in the test record are generated.

The Matlab code used to plot the SEM fixed frame method is included in Appendix C. The results again are shown for those records shown in Table 1.

Comments:

1. The decimation factor (dec) was set to three (3).

2. The reference frame length will have a variable length depending on the signal up to a maximum of one minute. The one minute limit was set rather arbitrarily to make sure it did not cover the entire record length.

3. The frame length for the test record was set to 10 seconds.

4. The FP1-F7, F7-T7, T7-P7, and P7-O1 signals were selected from the Physionet records to be studied in this part of the project.

5. Test Record Traces are plotted below. The collow code identify the area in which the SEM was either within acceptable range (green), in an ambiguous range (yellow) and in a range in which the SEM is beyond a reason value to consider the process properly characterized as being a white output (red).

The limits are:

|Green |SEMn ≤ Mean(SEM)+1 Sigma |

|Yellow |Mean(SEM)+1< Sigma SEMn< Mean(SEM)+2 Sigma |

|Red |SEMn ≥ Mean(SEM)+2 Sigma |

Note: These values may seem to indicate that the SEM distribution of the frames is gaussian. In fact it is not and no attempt was made to identify the actual distribution type. The mean and standard deviations are used only as a means to automate the decision level setting in a rather arbitrary way at this point.

Test A Results.

Record #1: chb02_15.edf, reference, non-seizure

Record #2: chb02_16+.edf, test record

Reference Frame Variance ([pic])

[pic]

Spectral Error Measure

[pic]

Test Record Traces

[pic]

Test B Results.

Record #1: chb12_24.edf, reference, non-seizure

Record #2: chb12_23.edf, test record

Reference Frame Variance ([pic])

[pic]

Spectral Error Measure

[pic]

Test Record Traces

[pic]

Comments on the results:

1. The results for both patients show the method is partially successful. The method did not succeed in pointing out exactly the time frame in which each seizure happened but it did identify the general area (see the red marked frames).

2. In observing the results for Test A this patient was reported to have a seizure starting at 2972 s that ended at 3053s. The method did not turn any of the traces studied red in this period of time but before and after this period there are areas of red so in the “general time” period some abnormal activity was detected.

3. The results for Test B show the method was actually quite successful. It detected all three areas in which seizures were reported on Physionet. It did however on some of the traces report other areas in red that were not reported as seizures which could indicate another physiological process was detected or some issue with a probe.

4. Based on these results there are two areas of concern with this method. First the exact levels at which to declare a seizure are not well defined and based on the mean and standard deviation of the SEM. The other area of concern is what actually is a good reference frame, while checking for dissimilarities using the SEM seems to prove effective there is no way in an automatic process to detect this until after the data is actually looked at. These issues preclude this and any other methodology discussed in reference [1] based on SEM from becoming a clinically accepted methodology.

5. A general discussion of AR modeling can be found in appendix F.

Part 4. Wigner-Ville distribution spectrogram

Wigner-Ville distribution (WVD) is a very useful tool when we need to analyze time-frequency representations of non-stationary signals. The Wigner-Ville distribution graphical appearance is very similar to a signal’s spectrogram. The definition is :

[pic]

The general idea is to compare the results of the common spectrogram with the WVD of the signal. As we know, if we want to get better resolution in frequency domain, we should increase the number of points in the time domain. But the challenge, with the application of this kind of distribution, is really to create a distribution with as many points in the time domain, having the same resolution in the frequency domain! This works ‘’IN THEORY’’, but the implementation needs some research.

The WVD approach used in this report follows closely that developed by Boashashand and Black, see reference [3]. Therefore, for EEG processing, Matlab code can be created in order to calculate the Wigner-Ville distribution of an EEG signal (see appendix E).

Test A: Record chb02_16+.edf

[pic]

Test B: Record chb12_23.edf

[pic]

Comments on the results:

- The Wigner-Ville distribution approach used in this report follows closely that developed by Boashashand and Black, see reference [3].

- Actually, the idea was to process by using Wigner-Ville distribution method and see what’s the difference between the spectrogram resulting from the AR modeling and the Wigner-Ville spectrogram. Well, at first sight both spectrogram shows the same results, and we can’t see a significant difference. What can be done in the future is to make some “trial’’ with others EEG signals and see the results for the respective spectrograms.

[pic]

[pic]

[pic]

[pic]

References:

1. Leif Sornmo and Pablo Laguna, “Bioelectrical Signal Processing in Cardiac and Neurological Applications” , Elsevier Academic Press, 2005.

2. G. Bodenstein and H.M. Praetorius, “Feature extraction from electroencephalogram by adaptive segmentation”, Proc. IEEE, vol. 65, no. 5, pp. 642 – 652, 1977

3. B. Boashashand P. Black, “An efficient real-time implementation of the Wigner-Ville distribution”, IEEE Transaction on Acoustics, Speech, and Signal Processing, vol. ASSP-35, NO. 11, November 1987. pp. 1611-1618

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download