Difference between revisions of "BCI-KurtusKahleFL2011"

From ESE497 Wiki
Jump to navigationJump to search
Line 3: Line 3:
  
 
In general, the methods used are a simple ear-reference, Bipolar filters, Common Average Reference (CAR) filters, and Laplacian filters.  Bipolar filters one electrode as the reference for another electrode.  CAR filters use the mean of every electrode's voltage at a given time as their zero.  Laplacian filters use several near neighbor electrodes to approximate a spatial second derivative of the signal.  While the Emotiv headset offers certain advantages for BCI applications, its limited number of electrodes in a limited number of locations makes generating accurate signals much more difficult, particularly for Laplacian filters.  Obtaining high-quality signals given these limitations is the primary goal of this investigation.
 
In general, the methods used are a simple ear-reference, Bipolar filters, Common Average Reference (CAR) filters, and Laplacian filters.  Bipolar filters one electrode as the reference for another electrode.  CAR filters use the mean of every electrode's voltage at a given time as their zero.  Laplacian filters use several near neighbor electrodes to approximate a spatial second derivative of the signal.  While the Emotiv headset offers certain advantages for BCI applications, its limited number of electrodes in a limited number of locations makes generating accurate signals much more difficult, particularly for Laplacian filters.  Obtaining high-quality signals given these limitations is the primary goal of this investigation.
 +
 +
== Background ==
 +
Due to conditions such as Stroke and Traumatic Brain Injury, 900,000 Americans have difficulty grasping objects with their hands.  Patients with these disorders often cannot complete otherwise simple actions such as holding a glass of water or hand-writing a note.  Additionally, such patients may have lost significant capacity for speech and mobility.  Often, the patients maintain the cognitive ability to communicate and move, but lack the neural pathways to complete these actions.  Brain-Computer Interfaces (BCI’s) may offer a solution to this problem by establishing a secondary connection between the brain and the outside world, via computer.
 +
 +
== Brain-Computer Interfaces ==
 +
A Brain-Computer Interface (BCI) is defined as any manmade device controlled by brain signals.  This research focuses on BCI's used to control hand motion, but it may be extended to other devices, such as wheelchairs or external communication devices.  Good candidates for any of these devices must have retained moderate or strong cognitive abilities.  If patients possess the ability to think about the desired outcome (e.g. opening the left hand, moving the wheelchair forward, or communicating a specific word), they can produce brain signals necessary to trigger the BCI.  Initially, brain signals may not consistently and effectively trigger the BCI because the signals that the system readily reads may not correspond to the signals that the brain readily produces for the desired outcome.  The brain, however, can learn to produce more waves at the desired frequencies over time.  Therefore, learning to use a BCI requires dozens of hours of practice, so candidate patients must be able to maintain focus for long periods of time.
 +
 +
== Signal Acquisition and Processing ==
 +
Signals are either retrieved from electrodes using either electroencephalography (EEG – electrodes on the scalp) or  electrocorticography (ECoG – electrodes immediately below the surface of the skull).  Since ECoG electrodes are located on the surface of the brain, they produce much higher-quality signal and much less noise than EEG electrodes.  However, situating ECoG electrodes requires drilling through the skull, which carries risks and is not consistently approved by the FDA.
 +
 +
This research project uses an Emotiv EPOC EEG headset, but the procedure presented here is applicable to other electrode schemes.  This headset was selected because EEG requires no no significant risks and because the EPOC can be situated on the head in a few minutes rather than perhaps a half hour for other headsets.  The EPOC has a total of 14 electrodes, so the spatial resolution of the data is much lower than for most clinical EEG headsets.
 +
 +
After acquired, the signal is Fast Fourier Transformed into the frequency domain.  Hence, we have power spectra for each electrode, for a variety of frequency bins, and for a few test conditions of our choosing.  At this point, we can directly compute the R^2 statistic for each electrode and frequency bin, comparing two test conditions.  In this experiment, the test conditions involve different hand motions versus the hand at rest.  R^2 is a unitless measurement of how consistent and different the signals are for two test conditions, from 0 (no correlation) to 1 (perfect correlation).  For example, if moving the right hand consistently produces a power reduction in the 12-Hz bin for the F7 electrode (figure ), that bin and electrode will have a high R^2.  With this headset and signal processing method, a somewhat trained subject might acquire a few R^2 values from about 0.3 to 0.5; this result means that 30 to 50% of the variance between signals from different test conditions (for a given bin and electrode) can be accounted for by the change in test condition.  Since we would like the result to approach 1, new and existing methods should be applied to improve signal quality and reduce noise.
 +
 +
== Spatial Filtering ==
 +
Noise often appears in specific spatial patterns.  For example, noise may be common to some area of the scalp and hence picked up by multiple electrodes.  If the noise is common to both electrodes but the desired signal is contained in one of the signals, subtracting one electrode's signal from the other will eliminate the noise but keep the signal.  Hence, linear combinations of signals, known as “spatial filters”, may eliminate, or filter, noise by considering the spatial locations of the noise and the electrodes.  For the commonly used spatial filters, a moving “zero” is found.
 +
 +
Up to now, a few different schemes of spatial filtering have been used.  When acquiring a signal, each electrode is generally referenced to another electrode behind the ear, which is referred to as “ear reference” or “no filter,” since it is the state of the signal before any filter has been applied.  Some common spatial filters used for large-array (many electrodes) EEG caps are shown in figure.  Common Average Reference (CAR) refers to a filter where the average of the signals from every electrode is taken as the zero.  A Bipolar filter is the simple subtraction of one electrode’s signal from another.  A Laplacian filter attempts to approximate a signal's spatial second derivative.  For a Small Laplacian filter, an average, weighted by distance, of the four nearest neighbor electrodes is computed and used as the reference.  For a Large Laplacian filter, the next-nearest neighbors are used in place of the nearest neighbors.
 +
 +
The same approach cannot be taken for Laplacian filters on the EPOC as on standard EEG arrays.  On standard clinical arrays, the electrodes are laid out in a grid, so the nearest neighbors can be selected as the electrodes immediately “North,” “South,” “East,” and “West” of the selected electrode.  Since there are not electrodes strictly in the “cardinal directions” for the EPOC headset, the following schemes were used:
 +
 +
== Optimizing Spatial Filters ==
 +
This project presents a novel method of determining a spatial filter.  Rather than using an invented scheme such as Bipolar, Laplacian, or CAR, this method uses an optimization routine to determine the filter.  Starting with a set of signals and an initial filter, MATLAB's fminsearch function varies the spatial filter, searching for the filter that maximizes R^2.  Optimization methods may produce higher values of R^2 than others, but they are highly subject to over-training.  In other words, the filter produced may work excellently on the data set used for training but poorly for other data sets.  This method also only produces local maxima.  The output will be the best filter that resembles the initial filters and similar filters; however, there may very well exist a filter that achieves a higher R^2 for that data set, or more importantly, for any arbitrary data set produced by a given subject.
 +
 +
== Temporal Alignment ==
 +
Rather than sampling all electrodes simultaneously once every sampling period, most EEG and ECoG systems sample each electrode sequentially.  This distinction is generally of no consequence for BCI's with simple spatial filtering schemes, but it can create significant noise in systems using electrodes sampled at substantially different times, which tends to occur when distant electrodes or many electrodes are combined.  Many EEG systems, for example that used in sample at 128 Hz.  If there are 64 electrodes, this could produce a phase difference between electrodes of about 8 ms.  The Emotiv EPOC does output at 128 Hz, but it samples internally at 2048 Hz, so it will produce a maximum phase difference of about 0.5 ms.
  
 
== Methods ==
 
== Methods ==
There are two methods being used to investigate spatial filtering.  First, those filters currently applied with clinical EEG caps, namely Bipolar, Laplacian, and CAR, are being exploredAn additional "Half CAR" filter will also be investigatedFor this filter, the reference for a given electrode will be the average of the electrodes in its respective hemisphere.  This filter may be more effective than the standard CAR if there is noise specific to one hemisphere, which may result from the brain signaling muscle motions to one side of the body, for example. The laplacian filter schema needs to be modified for this headsetNormally, four electrodes –– one from each side of the electrode under investigation –– would be used to create a referenceSuch a combination shows how the signal changes with respect to the sampling location.  The Emotiv Epoc headset does not have electrodes in the necessary locations for that procedure, so for this investigation, as many nearest electrodes as possible (either two or three) will be used.  For each of these filters, R^2 values will be computed and compared.
+
This study’s test subject was a healthy female, age 20.  The EPOC observed the subject’s brain signals for three trial conditions: actively moving the left hand, actively moving the right hand, and rest.  The subject was instructed to keep all hand motions consistent and not to blink during the trials, as blinking creates noise of several times greater amplitude than the rest of the signal.  The subject participated for three 15-minute sessions, during which the trial condition varied at random between the three possibilities.  The subject received no sensory feedback on the quality
 +
 
 +
All data were analyzed off-line.  First, R^2 was computed for referential, CAR, all possible bipolar, and the aforementioned modified version of the Laplacian filter.  Next, the first 80% of the data set from each of the three trials (the “training set”) was run through the optimization routine, each using three different initial spatial filtersThe first initial filter was the zero vectorThe second initial filter had a one for electrodes and a zero for all other electrodes, since we expect the most useful signals to originate in the regions of the brain associated with planning and motor skills.  The third filter was roughly CAR with a few electrodes weighted positively and more heavily, for those channels with high relative R^2 values.  R^2 values were computed for each training data set using all nine of output filters.  Each training set corresponds to a “testing set,” namely the other 20% of each of the initial data sets.  For each initial data set, the three output filters were applied to the corresponding testing set and R^2 was computed.  Finally, R^2 was computed for each complete data set using the third (estimated) filter.  This process was completed for data sets before and after temporal alignment.
 +
 
 +
== Results and discussion ==
 +
In general, referential spatial filtering produced higher R^2 values than Laplacian, bipolar, or common average reference filters. In the case of the third data set, where the referential filter produced a lower R^2 value (0.36 as opposed to .60 and .51, respectively), both bipolar and CAR somewhat outperformed referential. The significantly lower R^2 value in the third set indicates that some additional source of noise may have been more present in that trial then in the other trials,­ likely eyeblinks. If this assumption is true, then the spatial filters may have been effective in reducing the effect of this noise.
 +
 
 +
Seven out of nine optimized spatial filters performed better than referential or any other spatial filter when applied to the training set (i.e. the set that the spatial filter used for optimization), on average 5% better than referential. However, the optimized filters nearly all performed worse than referential on the testing sets, which indicates that the spatial filters were over-trained. These filters performed especially poorly on unrelated sets (i.e. the other two sets).
 +
 
 +
In general, the only spatial filters that consistently performed reasonably well across sets were referential, Laplacian, bipolar, CAR, and the estimated filters. The only filter that consistently performed very well across all sets was the referential.
 +
 
 +
== Conclusions and further research ==
 +
Although the results presented herein may not be convincing that spatial filters can significantly and consistently improve signal quality of EEG signals for BCI applications, that result has certainly been shown in the pastSeveral confounding factors influenced the results of this study, many of which could be improved in subsequent studies.
 +
 
 +
First, this study used only three data sets from a single subject.  Substantially more sets should be acquired from several more subjects who vary in age, sex, and health1Additionally, subjects must be trained considerably, to the point that they consistently produce similar results, which was not the case for this subject.  The same procedures may very well have produced better results if the subject were highly trained.
 +
 
 +
Eyeblinks can substantially impair results, and are commonly a major source of problems in BCI studies.  The subject was instructed not to blink during trials, but it is extremely difficult to avoid doing so.  Future studies should control for eyeblinks either by detecting eyeblinks in data sets and throwing out trials or sets that contain too many eyeblinks, or by removing eyeblinks digitally.
  
The second method is directly optimizing for linear combinations of electrodesUsing MATLAB, it is possible to find local maxima (and ideally the global maximum) of R^2 based on the variations in linear combination.
+
R^2 was used as the sole metric for signal quality, but many other classifiers and metrics for signal quality existFuture studies should attempt similar procedures using several different classifiers and metrics.
  
Another important factor in spatial filtering is the temporal alignment of the electrodes.  EEG headsets generally sample each electrode sequentially rather than all electrodes simultaneously.  This does not effect data for most applications, but in spatial filtering applications noise is produced when one waveform is subtracted from a similar waveform.  For this study, the data will be linearly interpolated to approximate the values that would be seen, were the electrodes sampled simultaneously.  Emotiv has provided data on approximate temporal offset between electrodes.  Those data will be used as the offset values for this study.  The R^2 values for uninterpolated and interpolated data will be comparedIn future studies, the offset could be found experimentally and higher order interpolation functions could be used rather than the linear model.
+
This study used fminsearch with a certain set of parameters to optimize on R^2.  Other sets of parameters and other optimization techniques exist, and they should be incorporated into future studies.
  
== Still to do ==
+
The estimated filter used as an initial point for the optimization routine performed surprisingly well on its own.  Researchers should develop and test algorithms to estimate good spatial filters based on the various R^2 values (or another metric) obtained from each electrode.
• Obtain and compare R^2 values for the each spatial filter created, with and without linear interpolation
 
  
• Code a script to optimize possible linear combinations of electrodes for R^2.
+
Additionally, when this research begins to show promise for improving signal quality, the techniques presented herein and otherwise could be used to develop multiple spatial filters for the same subject but different motions.  Such differing spatial filters could produce independent triggers for a BCI, resulting in multidimensional control.
  
 
== Further reading ==
 
== Further reading ==

Revision as of 04:43, 19 April 2012

Abstract

The purpose of this project is to determine the optimal spatial filtering techniques for a Brain-Computer Interface (BCI) using an Emotiv Epoc EEG headset. A spatial filter is type of tool used to improve the characteristics of a signal by linearly combining the outputs of multiple electrodes in a particular pattern. Those combinations produce a new signal with less noise, which gives BCI patients better control over a device, such as an orthosis.

In general, the methods used are a simple ear-reference, Bipolar filters, Common Average Reference (CAR) filters, and Laplacian filters. Bipolar filters one electrode as the reference for another electrode. CAR filters use the mean of every electrode's voltage at a given time as their zero. Laplacian filters use several near neighbor electrodes to approximate a spatial second derivative of the signal. While the Emotiv headset offers certain advantages for BCI applications, its limited number of electrodes in a limited number of locations makes generating accurate signals much more difficult, particularly for Laplacian filters. Obtaining high-quality signals given these limitations is the primary goal of this investigation.

Background

Due to conditions such as Stroke and Traumatic Brain Injury, 900,000 Americans have difficulty grasping objects with their hands. Patients with these disorders often cannot complete otherwise simple actions such as holding a glass of water or hand-writing a note. Additionally, such patients may have lost significant capacity for speech and mobility. Often, the patients maintain the cognitive ability to communicate and move, but lack the neural pathways to complete these actions. Brain-Computer Interfaces (BCI’s) may offer a solution to this problem by establishing a secondary connection between the brain and the outside world, via computer.

Brain-Computer Interfaces

A Brain-Computer Interface (BCI) is defined as any manmade device controlled by brain signals. This research focuses on BCI's used to control hand motion, but it may be extended to other devices, such as wheelchairs or external communication devices. Good candidates for any of these devices must have retained moderate or strong cognitive abilities. If patients possess the ability to think about the desired outcome (e.g. opening the left hand, moving the wheelchair forward, or communicating a specific word), they can produce brain signals necessary to trigger the BCI. Initially, brain signals may not consistently and effectively trigger the BCI because the signals that the system readily reads may not correspond to the signals that the brain readily produces for the desired outcome. The brain, however, can learn to produce more waves at the desired frequencies over time. Therefore, learning to use a BCI requires dozens of hours of practice, so candidate patients must be able to maintain focus for long periods of time.

Signal Acquisition and Processing

Signals are either retrieved from electrodes using either electroencephalography (EEG – electrodes on the scalp) or electrocorticography (ECoG – electrodes immediately below the surface of the skull). Since ECoG electrodes are located on the surface of the brain, they produce much higher-quality signal and much less noise than EEG electrodes. However, situating ECoG electrodes requires drilling through the skull, which carries risks and is not consistently approved by the FDA.

This research project uses an Emotiv EPOC EEG headset, but the procedure presented here is applicable to other electrode schemes. This headset was selected because EEG requires no no significant risks and because the EPOC can be situated on the head in a few minutes rather than perhaps a half hour for other headsets. The EPOC has a total of 14 electrodes, so the spatial resolution of the data is much lower than for most clinical EEG headsets.

After acquired, the signal is Fast Fourier Transformed into the frequency domain. Hence, we have power spectra for each electrode, for a variety of frequency bins, and for a few test conditions of our choosing. At this point, we can directly compute the R^2 statistic for each electrode and frequency bin, comparing two test conditions. In this experiment, the test conditions involve different hand motions versus the hand at rest. R^2 is a unitless measurement of how consistent and different the signals are for two test conditions, from 0 (no correlation) to 1 (perfect correlation). For example, if moving the right hand consistently produces a power reduction in the 12-Hz bin for the F7 electrode (figure ), that bin and electrode will have a high R^2. With this headset and signal processing method, a somewhat trained subject might acquire a few R^2 values from about 0.3 to 0.5; this result means that 30 to 50% of the variance between signals from different test conditions (for a given bin and electrode) can be accounted for by the change in test condition. Since we would like the result to approach 1, new and existing methods should be applied to improve signal quality and reduce noise.

Spatial Filtering

Noise often appears in specific spatial patterns. For example, noise may be common to some area of the scalp and hence picked up by multiple electrodes. If the noise is common to both electrodes but the desired signal is contained in one of the signals, subtracting one electrode's signal from the other will eliminate the noise but keep the signal. Hence, linear combinations of signals, known as “spatial filters”, may eliminate, or filter, noise by considering the spatial locations of the noise and the electrodes. For the commonly used spatial filters, a moving “zero” is found.

Up to now, a few different schemes of spatial filtering have been used. When acquiring a signal, each electrode is generally referenced to another electrode behind the ear, which is referred to as “ear reference” or “no filter,” since it is the state of the signal before any filter has been applied. Some common spatial filters used for large-array (many electrodes) EEG caps are shown in figure. Common Average Reference (CAR) refers to a filter where the average of the signals from every electrode is taken as the zero. A Bipolar filter is the simple subtraction of one electrode’s signal from another. A Laplacian filter attempts to approximate a signal's spatial second derivative. For a Small Laplacian filter, an average, weighted by distance, of the four nearest neighbor electrodes is computed and used as the reference. For a Large Laplacian filter, the next-nearest neighbors are used in place of the nearest neighbors.

The same approach cannot be taken for Laplacian filters on the EPOC as on standard EEG arrays. On standard clinical arrays, the electrodes are laid out in a grid, so the nearest neighbors can be selected as the electrodes immediately “North,” “South,” “East,” and “West” of the selected electrode. Since there are not electrodes strictly in the “cardinal directions” for the EPOC headset, the following schemes were used:

Optimizing Spatial Filters

This project presents a novel method of determining a spatial filter. Rather than using an invented scheme such as Bipolar, Laplacian, or CAR, this method uses an optimization routine to determine the filter. Starting with a set of signals and an initial filter, MATLAB's fminsearch function varies the spatial filter, searching for the filter that maximizes R^2. Optimization methods may produce higher values of R^2 than others, but they are highly subject to over-training. In other words, the filter produced may work excellently on the data set used for training but poorly for other data sets. This method also only produces local maxima. The output will be the best filter that resembles the initial filters and similar filters; however, there may very well exist a filter that achieves a higher R^2 for that data set, or more importantly, for any arbitrary data set produced by a given subject.

Temporal Alignment

Rather than sampling all electrodes simultaneously once every sampling period, most EEG and ECoG systems sample each electrode sequentially. This distinction is generally of no consequence for BCI's with simple spatial filtering schemes, but it can create significant noise in systems using electrodes sampled at substantially different times, which tends to occur when distant electrodes or many electrodes are combined. Many EEG systems, for example that used in sample at 128 Hz. If there are 64 electrodes, this could produce a phase difference between electrodes of about 8 ms. The Emotiv EPOC does output at 128 Hz, but it samples internally at 2048 Hz, so it will produce a maximum phase difference of about 0.5 ms.

Methods

This study’s test subject was a healthy female, age 20. The EPOC observed the subject’s brain signals for three trial conditions: actively moving the left hand, actively moving the right hand, and rest. The subject was instructed to keep all hand motions consistent and not to blink during the trials, as blinking creates noise of several times greater amplitude than the rest of the signal. The subject participated for three 15-minute sessions, during which the trial condition varied at random between the three possibilities. The subject received no sensory feedback on the quality

All data were analyzed off-line. First, R^2 was computed for referential, CAR, all possible bipolar, and the aforementioned modified version of the Laplacian filter. Next, the first 80% of the data set from each of the three trials (the “training set”) was run through the optimization routine, each using three different initial spatial filters. The first initial filter was the zero vector. The second initial filter had a one for electrodes and a zero for all other electrodes, since we expect the most useful signals to originate in the regions of the brain associated with planning and motor skills. The third filter was roughly CAR with a few electrodes weighted positively and more heavily, for those channels with high relative R^2 values. R^2 values were computed for each training data set using all nine of output filters. Each training set corresponds to a “testing set,” namely the other 20% of each of the initial data sets. For each initial data set, the three output filters were applied to the corresponding testing set and R^2 was computed. Finally, R^2 was computed for each complete data set using the third (estimated) filter. This process was completed for data sets before and after temporal alignment.

Results and discussion

In general, referential spatial filtering produced higher R^2 values than Laplacian, bipolar, or common average reference filters. In the case of the third data set, where the referential filter produced a lower R^2 value (0.36 as opposed to .60 and .51, respectively), both bipolar and CAR somewhat outperformed referential. The significantly lower R^2 value in the third set indicates that some additional source of noise may have been more present in that trial then in the other trials,­ likely eyeblinks. If this assumption is true, then the spatial filters may have been effective in reducing the effect of this noise.

Seven out of nine optimized spatial filters performed better than referential or any other spatial filter when applied to the training set (i.e. the set that the spatial filter used for optimization), on average 5% better than referential. However, the optimized filters nearly all performed worse than referential on the testing sets, which indicates that the spatial filters were over-trained. These filters performed especially poorly on unrelated sets (i.e. the other two sets).

In general, the only spatial filters that consistently performed reasonably well across sets were referential, Laplacian, bipolar, CAR, and the estimated filters. The only filter that consistently performed very well across all sets was the referential.

Conclusions and further research

Although the results presented herein may not be convincing that spatial filters can significantly and consistently improve signal quality of EEG signals for BCI applications, that result has certainly been shown in the past. Several confounding factors influenced the results of this study, many of which could be improved in subsequent studies.

First, this study used only three data sets from a single subject. Substantially more sets should be acquired from several more subjects who vary in age, sex, and health1. Additionally, subjects must be trained considerably, to the point that they consistently produce similar results, which was not the case for this subject. The same procedures may very well have produced better results if the subject were highly trained.

Eyeblinks can substantially impair results, and are commonly a major source of problems in BCI studies. The subject was instructed not to blink during trials, but it is extremely difficult to avoid doing so. Future studies should control for eyeblinks either by detecting eyeblinks in data sets and throwing out trials or sets that contain too many eyeblinks, or by removing eyeblinks digitally.

R^2 was used as the sole metric for signal quality, but many other classifiers and metrics for signal quality exist. Future studies should attempt similar procedures using several different classifiers and metrics.

This study used fminsearch with a certain set of parameters to optimize on R^2. Other sets of parameters and other optimization techniques exist, and they should be incorporated into future studies.

The estimated filter used as an initial point for the optimization routine performed surprisingly well on its own. Researchers should develop and test algorithms to estimate good spatial filters based on the various R^2 values (or another metric) obtained from each electrode.

Additionally, when this research begins to show promise for improving signal quality, the techniques presented herein and otherwise could be used to develop multiple spatial filters for the same subject but different motions. Such differing spatial filters could produce independent triggers for a BCI, resulting in multidimensional control.

Further reading

McFarland, D. J., McCane, L. M., David, S. V., & Wolpaw, J. R. (1997). Spatial filter selection for eeg-based communication. Electroencephalography and clinical Neurophysiology, (103), 386-384.

Ramoser, H., Müller-Gerking, J., & Pfurtscheller, G. (2000). Optimal spatial filtering of single trial eeg during imagined hand movement. IEEE Transactions on Rehabilitation Engineering, 6(4), 441-446.