We present a novel approach to describe a P300 by a shape-feature vector, which offers several advantages over the feature vector used by the BCI2000 system. Additionally, we present a calibration algorithm that reduces the dimensionality of the shape-feature vector, the number of trials, and the electrodes needed by a Brain Computer Interface to accurately detect P300s; we also define a method to find a template that best represents, for a given electrode, the subject’s P300 based on his/her own acquired signals. Our experiments with 21 subjects showed that the SWLDA’s performance using our shape-feature vector was
The P300 is an event-related potential (ERP) endogenous component that has a positive deflection that occurs in the scalp-recorded electroencephalogram (EEG) and typically elicited approximately 300 ms after the presentation of an infrequent stimulus (such as visual, auditory, or somatosensory) [
The features of a P300 have been represented in time, frequency, time-frequency, and shape domains by using, among others, Wavelet Transform [
In this work, we are interested in the shape domain because we assume that (i) every subject produces P300 signals whose waveform can be consistently represented by template curves and (ii) such template curves from a subject are more similar to curves with a P300 than to curves produced by EEG background activity [
The novelty of this paper consists in the detection of P300 trials based on using pattern recognition techniques on its shape, represented by a feature vector. Specifically, we use a contour representation based on an adapted version of the Slope Chain Code (SCC) and some of its properties (e.g., the tortuosity measure) [
We organized the paper as follows. In Section
In this section, we describe the features of the ERP’s waveform that we use as the vector of characteristics. Additionally, we present an offline calibration algorithm that reduces the dimensionality of the shape-feature vector, the number of trials for a subject, and the number of electrodes needed by a BCI to detect a subject’s P300.
As we mentioned before, the vector of characteristics obtained from the waveform of a P300 is central to our work. A first step towards producing such a vector is the coherent averaging of a set of trials.
It is a well-known fact that coherent averaging increases the SNR in signals and we take advantage of this fact to enhance the small amplitude signals immersed in an EEG. We and other groups [
In a common BCI experiment, a number of electrodes are used to acquire EEG signals. We refer to this number as
Because we intend to use the waveform of the recorded ERP signals to generate the vector of features, we represent a recorded signal
Chain codes are alphanumeric sequences with integer alphabets being the most common choices because the easiness and velocity to process the resulting chains in comparison to those based on alphanumeric alphabets. Several integer-alphabet chain codes have been proposed [
In this work, we adapted the SCC to represent ERP signals and called it Slope Horizontal Chain Code (SHCC). The main differences between the SCC and our code are the following. The SHCC adjusts a segment’s length to avoid interpolation; this adjustment takes advantage of the sampling uniformity during the biosignal acquisition to keep the sampling points as the endpoints of segments. Contrary to the SCC, the SHCC does not compute the angle between two adjacent segments; in contrast, it computes the slope between a segment and the horizontal in the continuous range equivalent to (
On the other hand, the SHCC and the SCC share the following very useful properties for our application: both place line segments onto the curve to preserve with high resolution the contour shape, both are translation-invariant, which is relevant since the SHCC can adequately represent P300’s variability, and both allow feature dimensionality and data reduction. The two are very desirable properties in BCI applications [
A first step to transform the curve into a chain by the SHCC is to resample the vector
Before obtaining the alphabet symbols, the SHCC normalizes every element
These operations produce new coordinate vectors
Example of a P300 discretized curve and its resulting chain code by using the SHCC method.
Original curve
Discretized curve
Chain of the discretized curve
Finally, to form a vector of characteristics, we consider the elements of a chain obtained with the aforementioned SHCC method as part of the features of the vector together with other characteristics as we will show below.
The possibility of computing the distance between two curves is an important characteristic that we take advantage of for our proposed method. Since we use the SHCC to represent 2D curves, we obtain a unique curve descriptor represented by a chain. The hypothesis is that the chain representing a P300 template is more similar to the chain of a P300 than to the chain from a non-P300.
There are several distances to measure shape dissimilarity for 2D curves such as the Manhattan (i.e., the
Illustration of the difference between a subject’s template curve and (a) a P300 curve and (b) a non-P300 curve.
Another feature that we would like to capture is how straight or twisted a curve is; one way to measure such a characteristic is by
Both the SCC and the SHCC describe the signals waveform at the expense of losing voltage information; the latter is useful for discrimination between conditions. Moreover, two curves having different shape could have the same tortuosity. For these reasons, we introduce an additional way to compare two curves by computing the difference between their areas. To this end, we apply the trapezoidal rule [
Finally, for every electrode, we assemble a
Like any other BCI system that uses a feature vector, we need to calibrate ours for every subject. For our project, the goals of the calibration are (i) to obtain a template for every electrode that best represents a subject’s P300 in that electrode, (ii) to obtain the optimum number of stimulations, (iii) to select the subset of electrodes that provides the best P300 signal, and (iv) to select the shape features that maximize the
In what follows, we define some sets and variables necessary for our calibration algorithm. For the calibration process, we select a certain number of P300-labeled trials and a certain number of non-P300-labeled trials for a given electrode
Algorithm
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
A general view of the calibration algorithm is as follows. The iterative algorithm is made of several sections that carry a specific task and are called
Now, we describe the inner
Every template chain
After these comparisons, we obtain two shape-feature vectors
To evaluate the performance of the calibration process by using one template at a time, we decided to use the computed distances between chains as accuracy measures (based on preliminary experiments); this process is carried out in line 18 by the operator
As mentioned earlier, one of the goals of the principal
As we mentioned before, some goals of the principal
For our experiments, we used the EEG signal database as reported in [
The EEG-signal database was acquired using 10 electrodes denoted by Fz, C4, Cz, C3, P4, Pz, P3, PO8, Oz, and PO7 following the international 10-20 system (see the configuration in Figure
The electrode configuration used in the current study. The EEG was acquired by 10 electrodes located at the international 10-20 system. Image from [
Despite the fact that our proposed method can be used in any BCI application, we decided to apply it to the P300 word speller, first described by [
The participants were asked to spell
For the experiments, the participants sat in front of the computer screen, which is divided into two sections. At the top left corner of the screen, the word to be spelled was displayed while the character currently specified for selection was listed in parenthesis at the end of the word. The remaining of the screen displays a
The
The matrix rows and columns were randomly intensified 15 times (i.e., trials) for every letter. The subjects were asked to silently count the number of times the target character was intensified while the matrix rows and columns flashed every 125 ms in random order (i.e., the interstimulus time); every flash lasted 62.5 ms. Because of the nature of the signal, we expected to have a P300 wave 300 ms after every stimulus. For this reason, we decided to extract the next 800 ms of EEG data after every stimulus per channel used in the analysis; thus, we collected around 2 P300 waves in every trial due to the interstimulus time. Each segment of 800 ms was filtered offline using a 4th-order Butterworth bandpass filter with bandwidth range from 0.1 to 12 Hz to extract the ERP signals embedded in the EEG as it is common in the field [
Now, we explain the methodology used to select the parameters
Our goal is to preserve the P300’s envelope by the minimum representation possible while allowing its detection with the SHCC (see Section
On the other hand, to determine the number of trials necessary for a template to accurately represent a subject’s P300 for each electrode, we ran experiments with the calibration algorithm varying the values of
Behavior of the calibration AUROC while running several calibration experiments with a fixed
In this section, we report and discuss the design and results of our experiments; they test the performance of our method in detecting P300 trials based on its shape-feature vector.
In order to test the performance of the calibration algorithm, we fixed the values for parameters
We performed the cross-validation of the Calibration Algorithm with the training dataset
Ranking of electrodes according to mean
It is worth noting that the normalization process performed by the SHCC could be sensitive to outliers. However, the filters and the subsampling we applied to the signal reduce outliers. Moreover, the AUROCs reflect an adequate performance, even with a nonoptimal normalization.
On the other hand, it is common practice to stimulate a subject fifteen times for every letter [
Optimum number of stimulations. The middle column shows the best electrode for each subject.
Subjects | Electrodes | Stimulations |
---|---|---|
ACS | Cz | 7 |
APM | Fz | 7 |
ASG | PO8 | 5 |
ASR | Fz | 15 |
CLL | PO8 | 15 |
DCM | PO8 | 2 |
DLP | Cz | 15 |
DMA | C4 | 8 |
ELC | Pz | 5 |
FSZ | Pz | 15 |
GCE | PO8 | 5 |
ICE | Cz | 4 |
JCR | Oz | 15 |
JLD | Cz | 9 |
JLP | Cz | 15 |
JMR | PO8 | 4 |
JSC | Fz | 9 |
JST | PO7 | 3 |
LAC | PO7 | 4 |
LAG | PO8 | 15 |
LGP | PO7 | 14 |
Additionally, we analyzed the behavior of the sets of electrodes for all subjects based on calibrations
Incidence of subjects whose mean AUROC during the calibration process was greater than or equal to 0.8 when they are stimulated an optimum number of times (see Table
We have hypothesized that the discrepancy between the incidences shown above is the result of the criterion that we use for selecting the electrodes. Certainly, there can be other criteria for this selection like statistical tools such as a
After carrying out the selection of electrodes, we found out that the best information is provided by electrodes C4, Cz, Fz, Pz, PO7, PO8, and Oz, unlike the P3, C3, and P4 electrodes whose information can be discarded since they did not contribute to a desired performance. These results are consistent with the literature [
The aim of the validation process is to analyze the performance of the P300 detection when using our shape-feature vector
In the first experiment, we extracted a balanced subset
The average accuracy for the studied population
Ranking of electrodes according to the average accuracy of classifiers SWLDA and SVM for the studied population, where electrode 1 corresponds to the performance of the selected features, which includes information from all the electrodes, computed with the template of the best performing electrode for each subject (not necessarily the same), while electrode 7 is the one with the lowest
Detailed accuracy
In order to evaluate the second experiment, we used an unseen unbalance set
Comparison between the percentage of correct P300 detection by using the shape-feature vector (SFV) and the vector used by BCI2000 system (DV).
On the other hand, we evaluated the dimensionality reduction. We selected the elements of the shape-feature vector by the stepwise regression method. We observed that the SRM computes the maximum size of a vector (equal to 38 per electrode), because no additional terms satisfy the entry and removal criteria. However, it is possible to reduce even further the dimensionality of the vector while keeping an accuracy of one at least for one electrode; that was the case for nine subjects using the SWLDA and eight subjects using the SVM.
Finally, we compare other methods with ours. As mentioned earlier, the idea that a P300 is more similar to a template whose waveform resembles that of a P300 than to a non-P300 is not new. As mentioned in Section
The P300 is an ERP elicited after the presentation of an infrequent stimulus. This endogenous component possesses some useful properties that permit controlling BCI applications [
In order to demonstrate our main hypothesis that our shape-feature vector improves the P300 detection accuracy, we designed some experiments which demonstrated that the performance of the SWLDA classifier is better when applying our feature vector than when applying the one used in the BCI2000 system [
Because calibration is a crucial step of any BCI system, we have proposed a calibration methodology that achieves the following goals: (i) it obtains a set of templates that best represents, for a given electrode, the subject’s P300 based on his/her own acquired signals, (ii) it finds the optimal number of trials for every subject, (iii) it selects the subset of electrodes that provides the best P300 signal for every subject, and (iv) it selects the shape features that maximize the classification accuracy while reducing the dimensionality of the feature vector. Our statistical tests showed that our method achieves a high average accuracy in the detection of P300 signals with fewer than fifteen stimulations. Furthermore, in agreement with the literature [
Our future work will focus on the implementation of our methodology to a BCI. Additionally, we are planning further studies to analyze the robustness of the computed templates over time. Because there is evidence that the use of grammatical techniques and syntactic analysis yields promising results, we plan to investigate these techniques for detecting the P300 using the chain code approach. Finally, our chain code can be easily implemented on integer-number arithmetic; this makes it suitable for an efficient hardware implementation that integrates a classifier into signal acquisition devices, something that we are currently exploring.
The authors declare that there is no conflict of interests regarding the publication of this paper.
Montserrat Alvarado-González was supported by CONACyT under the agreement 167254. The authors would like to thank Erik Bojorges from the LINI for providing the code for reading and filtering ERP signals. The authors thank the referees for their constructive comments that significantly improved the paper.