Method Article

P300-Based Brain-Computer Interface Speller Performance Estimation with Classifier-Based Latency Estimation

DOI:

10.3791/64959

September 8th, 2023

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This article presents a method for estimating same-day P300 speller Brain-Computer Interface (BCI) accuracy using a small testing dataset.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Performance estimation is a necessary step in the development and validation of Brain-Computer Interface (BCI) systems. Unfortunately, even modern BCI systems are slow, making collecting sufficient data for validation a time-consuming task for end users and experimenters alike. Yet without sufficient data, the random variation in performance can lead to false inferences about how well a BCI is working for a particular user. For example, P300 spellers commonly operate around 1-5 characters per minute. To estimate accuracy with a 5% resolution requires 20 characters (4-20 min). Despite this time investment, the confidence bounds for accuracy from 20 characters can be as much as ±23% depending on observed accuracy. A previously published method, Classifier-Based Latency Estimation (CBLE), was shown to be highly correlated with BCI accuracy. This work presents a protocol for using CBLE to predict a user's P300 speller accuracy from relatively few characters (~3-8) of typing data. The resulting confidence bounds are tighter than those produced by traditional methods. The method can thus be used to estimate BCI performance more quickly and/or more accurately.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Brain-computer interfaces (BCIs) are a noninvasive technology that allows individuals to communicate through machines directly without regard for physical limitations imposed by the body. BCI can be utilized as an assistive device operated directly by the brain. BCI uses the brain activity of a user to determine if the user intends to choose a certain key (letter, number, or symbol) displayed on the screen1. In a typical computer system, a user physically presses the intended key on a keyboard. However, in a BCI system with a visual display, the user needs to focus on the desired key. Then, BCI will select the intended key by analyzing the measured brain signals1. The activity of the brain can be measured using various techniques. Though there are competing BCIs technologies, electroencephalogram (EEG) is considered a leading technique due to its noninvasive nature, high temporal resolution, reliability, and relatively low cost2.

Applications of BCI include communication, device control, and also entertainment3,4,5,6. One of the most active BCI application areas is the P300 speller, which was introduced by Farwell and Donchin7. The P300 is an event-related potential (ERP) produced in response to the recognition of a rare but relevant stimulus8. When a person recognizes their target stimulus, they automatically produce a P300. The P300 is an effective signal for a BCI because it conveys the participant's recognition of the target event without requiring an outward response9.

The P300 BCI has attracted researchers from computer science, electrical engineering, psychology, human factors, and various other disciplines. Advances have been made in signal processing, classification algorithms, user interfaces, stimulation schemes, and many other areas10,11,12,13,14,15. However, regardless of the research area, the common thread in all of this research is the necessity of measuring the BCI system performance. This task typically requires the generation of a test data set. This necessity is not limited to research; eventual clinical application as an assistive technology will likely require individual validation sets for each end user to ensure the system can generate reliable communication.

Despite the considerable research applied toward the P300 BCI, the systems are still quite slow. While the majority of people are able to use a P300 BCI16, most P300 Spellers produce text on the order of 1-5 characters per minute. Unfortunately, this slow speed means that generating test data sets requires substantial time and effort for participants, experimenters, and eventual end users. Measuring BCI system accuracy is a binomial parameter estimation problem, and many characters of data are necessary for a good estimate.

To estimate the presence or absence of the P300 ERP, most classifiers use a binary classification model, which involves assigning a binary label (e.g., "presence" or "absence") to each trial or epoch of EEG data. The general equation used by most classifiers can be expressed as:

Regression equation, ŷ(x)=wᵀ·f(x)+b, mathematical expression for machine learning prediction.

where Equilibrium equation ΣFy=0, diagram shows forces balance, static equilibrium, education keywords. is called the classifier's score, which represents the probability of the P300 response being present, x is the feature vector extracted from the EEG signal, and b is a bias term17. The function f is a decision function that maps the input data to the output label, and is learned from a set of labeled training data using a supervised learning algorithm17. During training, the classifier is trained on a labeled dataset of EEG signals, where each signal is labeled as either having a P300 response or not. The weight vector and bias term are optimized to minimize the error between the predicted output of the classifier and the true label of the EEG signal. Once the classifier is trained, it can be used to predict the presence of the P300 response in new EEG signals.

Different classifiers can use different decision functions, such as linear discriminant analysis (LDA), stepwise linear discriminant analysis (SWLDA), least squares (LS), logistic regression, support vector machines (SVM), or neural networks (NNs). The least squares classifier is a linear classifier that minimizes the sum of squared errors between the predicted class labels and the true class labels. This classifier predicts the class label of a new test sample using the following equation:

Linear classification formula ŷ(x)=sign(𝑤*𝑥), mathematical equation for machine learning.    (1)

where the sign function returns +1 if the product is positive and -1 if it is negative, and the weight vector Static equilibrium equations ΣFx=0, graph depicting balance analysis, educational physics diagram. is obtained from the feature set of the training data, (x) and class labels (y) using the below equation:

Weighted linear regression equation, W=(X^TX)^-1X^Ty, used for statistical data fitting.    (2)

In earlier research, we argued that Classifier-Based Latency Estimation (CBLE) can be used to estimate BCI accuracy17,18,19. CBLE is a strategy for evaluating latency variation by exploiting the classifier's temporal sensitivity18. While the conventional approach to P300 classification involves using a single time window that is synchronized with each stimulus presentation, the CBLE method involves creating multiple time-shifted copies of the post-stimulus epochs. Then it detects the time shift that results in the maximum score in order to estimate the latency of the P300 response17,18. Here, this work presents a protocol that estimates BCI performance from a small dataset using CBLE. As a representative analysis, the number of characters is varied to make predictions of the overall performance of an individual. For both example datasets, the root mean square error (RMSE) for vCBLE and actual BCI accuracy were computed. The results indicate that the RMSE from vCBLE predictions, using its fitted data, was consistently lower than the accuracy derived from 1 to 7 tested characters.

We developed a Graphical User Interface (GUI) called "CBLE Performance Estimation" for the implementation of the proposed methodology. The example code is also provided (Supplementary Coding File 1) that operates on the MATLAB platform. The example code performs all of the steps applied in the GUI, but the steps are provided to assist the reader with adapting to a new dataset. This code employs a publicly available dataset "Brain Invaders calibration-less P300-based BCI using dry EEG electrodes Dataset (bi2014a)" to evaluate the proposed method20. Participants played up to three game sessions of Brain Invaders, each session having 9 levels of the game. The data collection continued until all levels were completed or the participant lost all control over the BCI system. The Brain Invaders interface included 36 symbols that flashed in 12 groups of six aliens. According to the Brain Invaders P300 paradigm, a repetition was created by 12 flashes, one for each group. Out of these 12 flashes, two flashes contained the Target symbol (known as Target flashes), while the remaining 10 flashes did not contain the Target symbol (known as non-Target flashes). More information on this paradigm can be found in the original reference20.

The CBLE approach was also implemented on a Michigan dataset, which contained data from 40 participants18,19. Here, the data of eight participants had to be discarded because their tasks were incomplete. The whole study required three visits from each participant. On the first day, each participant typed a 19-character training sentence, followed by three 23-character testing sentences on Days 1, 2, and 3. In this example, the keyboard included 36 characters which were grouped into six rows and six columns. Each row or column was flashed for 31.25 milliseconds with an interval of 125 milliseconds between flashes. Between characters, a 3.5 s pause was provided.

Figure 1 shows the block diagram of the proposed method. The detailed procedure is described in the protocol section.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The "CBLE Performance Estimation" GUI was applied to two datasets: "BrainInvaders" dataset and Michigan dataset. For the "BrainInvaders" dataset, the data collection was approved by the Ethical Committee of the University of Grenoble Alpes20. Michigan data were collected under the University of Michigan Institutional Review Board approval19. Data were analyzed under Kansas State University exempt protocol 7516. If collecting new data, follow the user's IRB-approved process for collecting informed consent. Here, the proposed protocol is evaluated using offline analysis of previously-recorded, de-identified data and therefore did not require additional informed consent.

The graphical user interface (GUI) included in this article is proficient in managing two distinct dataset formats. The first format is associated with the BCI2000 software, while the second format is referred to as the "BrainInvaders" dataset. In order to utilize the "Brain Invaders" format, data must be pre-processed as described in step 1 of the protocol section. However, when dealing with the "BCI2000" dataset format, step 1 can be omitted.

1. Data preparation

  1. BrainInvaders only: Generate the input data file in ".mat" file format that can be used with the "CBLE performance Estimation" graphical user interface (GUI). For a sample script, refer to Supplementary Coding File 2.
    NOTE: Each data file consists of a two-dimensional matrix comprised of rows that represent observations recorded at distinct time samples. The matrix columns numbered 2 to 17 are recordings derived from 16 EEG electrodes. The first column of the matrix denotes the timestamp of each observation, while column 18 encompasses information related to experimental events. In column 19, there are mostly zeros, but when a non-Target (or Target) flash starts, the numbers change to one (or two) at that specific time. A detailed description may be found in the reference20.

2. Downloading and installing the GUI package

  1. Download and install the "CBLE Performance Estimation" GUI.

3. Storing the dataset in a subfolder of the GUI location

  1. Ensure that the dataset folder remains within the same directory as the GUI.
  2. For instance, create a new folder and place the "CBLE Performance Estimation" GUI inside it. Keep all the datasets in a subfolder within "CBLE GUI" named "Dataset."

4. Opening the installed GUI

  1. Open MATLAB (see Table of Materials), change the current directory to the folder where the GUI is placed, click on APPS tab, and select MY APPS.
  2. Under the "MY APPS" tab, select CBLE Performance Estimation.

5. Choosing the dataset format

  1. Select a dataset format from the dropdown Select dataset format.

6. Loading the EEG data file

  1. Click on the Select input folder button to choose the directory where the dataset is located.
  2. Observe the count of data files present in that selected folder.
    NOTE: In the "Brain Invaders" format, each participant is represented by a single data file. Therefore, the total number of data files indicates the number of participants in the study. However, this is not the case for the "BCI2000" format, as each participant may have multiple train and test files.

7. Setting the parameters

  1. Type the number of participants that the user intends to use for the estimation process in the "No. of participants" text box.
  2. BrainInvaders only: Specify the sampling rate of the dataset.
    NOTE: BCI2000 files include the sample rate.
  3. Choose a decimation value to downsample the dataset to approximately 20 Hz in order to improve classification performance21. For example, if the sampling frequency is 256 Hz, then select a decimation value of 13.
  4. Specify the time window for the classification in milliseconds.
    NOTE: The recommended initial window size is specified, allowing the starting point to vary from 0 to 100 ms and the ending point from 700 to 800 ms. However, it is important to avoid making the window size excessively large to prevent overlapping with another P300 event.
  5. Define the shift window for CBLE in milliseconds.
    NOTE: The 'shift window' refers to the expanded time range that the CBLE method searches to find the P3 response.  The classifier will be applied to the epoch starting at the first element of the shift window.  The classifier is then sequentially applied to epochs starting one sample later, until the epoch extends outside the shift window.  Thus, the shift window must be larger than the original window; empirically, values less than 100 ms from each side perform well.  In any case, the margin should be held to less than half the ISI.
  6. BC2000 only: Enter the length of the subject ID indicated in the dataset files within the "ID length" field.
    NOTE: The GUI expects the first sub_len characters of the filenames to encode the subject ID.
  7. BCI2000 only: In the "Channel ID" field, indicate either the total number of channels or specify the specific channel numbers to be used for the analysis.
  8. Click on the Set parameters button to set all the parameters required for the analysis.

8. BrainInvaders only: Splitting the dataset into training and test set

  1. Select a number of targets that represents the size of the training set. The remaining portion of the dataset will be considered as the test dataset.
    NOTE: To ensure proper training of the model, it is essential to have a sufficiently large training sample. The recommended minimum training sample size is 20, though this may vary depending on the overall dataset size. If regression errors occur during training sessions, it is advisable to increase the training sample size.
  2. Press the "Split the dataset" button to divide the dataset into the training and test sets.
    ​NOTE: Each participant will have an equal amount of training data. However, the number of test data may not be equal for all participants due to the possibility of multiple attempts during the task. Consequently, the total number of targets or flashes presented may vary from person to person.

9. Training a model with the training dataset

NOTE: Step 9.1 is applicable for "Brain Invaders" format, and step 9.2 is applicable for "BCI2000" format.

  1. BrainInvaders only: Click on the Train a model button to apply linear regression on the training dataset using Equation 2 for training a classifier model.
  2. BCI2000 only: Indicate training and testing filenames along with their data format (.dat) to distinguish the training and testing files from all files. Then, click on the Train a model button to apply linear regression on the training dataset.

10. Predicting the accuracy of the test set

  1. Click on Predict accuracy to apply the trained classifier model to the test feature set and predict accuracy using Equation 1.

11. Getting X-target accuracies

  1. Select a maximum target number, X, to consider in the test set.
  2. BCI2000 only: Select a test file number if the user has multiple test files.
  3. Press Find X target accuracy.

12. Calculating vCBLE

  1. Click on the Find vCBLE button to get the vCBLE for all targets.

13. Calculating the Root mean square error (RMSE) of BCI accuracy and vCBLE

  1. Click on the Calculate RMSE button to calculate the RMSE between both predictions based on vCBLE with BCI accuracy, and X-target accuracy with BCI accuracy.

14. Visualizing the analysis results

  1. Click on the Accuracy vs vCBLE button to observe the relation between total accuracy and total vCBLE for all participants.
  2. Press on the RMSE of BCI & vCBLE button to show the RMSE curve of BCI accuracy and vCBLE.

15. Predicting the performance of an individual participant

  1. To predict the accuracy of an individual participant, place the subject ID in Sub ID.
    NOTE: Here, the dataset of all participants, excluding the test participant, will be used to train a linear regression model. The vCBLE scores of all other participants and their corresponding test accuracies will be utilized as predictors and labels, respectively, for the classifier.
  2. Select a target number, n. The prediction will be made based on the accuracy of n-testing characters.
  3. Click on the Predict button to get the predicted accuracy of the test participant.

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The proposed protocol has been tested on two different datasets: "BrainInvaders" and the Michigan dataset. These datasets are already introduced briefly in the Introduction section. The parameters used for this two datasets are mentioned in Table 1. Figures 2-4 depict the findings obtained using the "BrainInvaders" dataset, whereas Figures 5-7 demonstrate the results achieved fr...

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This article outlined a method for estimating BCI accuracy using a small P300 dataset. Here, the current protocol was developed based on the "bi2014a" dataset, although the efficacy of the protocol was confirmed on two different datasets. To successfully implement this technique, it is crucial to establish certain variables, such as the epoch window for the original data, the window for time shifting, the down-sampling ratio, and the size of both the training and testing datasets. These variables are determined b...

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

All authors declare they do not have any conflicts of interest.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The data used for representative results were collected from the work supported by the National Institute of Child Health and Human Development (NICHD), the National Institutes of Health (NIH) under Grant R21HD054697, and the National Institute on Disability and Rehabilitation Research (NIDRR) in the Department of Education under Grant H133G090005 and Award Number H133P090008. The rest of the work was funded in part by the National Science Foundation (NSF) under award #1910526. Findings and opinions within this work do not necessarily reflect the positions of NICHD, NIH, NIDRR or NSF.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
MATLAB 2021MatlabN/AAny recent MATLAB version can be used.

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Rezeika, A., Benda, M., Stawicki, P., Gembler, F., Saboor, A., Volosyak, I. Brain-Computer Interface spellers: A review. Brain Science. 8 (4), 57(2018).
  2. Gannouni, S., Aledaily, A., Belwafi, K., Aboalsamh, H. Emotion detection using electroencephalography signals and a zero-time windowing-based epoch estimation and relevant electrode identification. Scientific Reports. 11 (1), 7071(2021).
  3. Daly, J. J., Wolpaw, J. R. Brain-computer interfaces in neurological rehabilitation. Lancet Neurology. 7 (11), 1032-1043 (2008).
  4. Birbaumer, N. Breaking the silence: brain-computer interfaces (BCI) for communication and motor control. Psychophysiology. 43 (6), 517-532 (2006).
  5. Riccio, A., Simione, L., Schettini, F., Pizzimenti, A., Inghilleri, M., Belardinelli, M. O. Attention and P300-based BCI performance in people with amyotrophic lateral sclerosis. Frontiers in Human Neuroscience. 7, 732(2013).
  6. Finke, A., Lenhardt, A., Ritter, H. The MindGame: a P300-based brain-computer interface game. Neural Network. 22 (9), 1329-1333 (2009).
  7. Farwell, L. A., Donchin, E. Talking off the top of your head: toward a mental prosthesis utilizing event-related brain potentials. Electroencephalogr. Clinical Neurophysiology. 70 (6), 510-523 (1988).
  8. Li, Q., Lu, Z., Gao, N., Yang, J. Optimizing the performance of the visual P300-speller through active mental tasks based on color distinction and modulation of task difficulty. Frontiers in Human Neuroscience. 13, 130(2019).
  9. McFarland, D. J., Sarnacki, W. A., Townsend, G., Vaughan, T., Wolpaw, J. R. The P300-based brain-computer interface (BCI): effects of stimulus rate. Clinical Neurophysiology. 122 (4), 731-737 (2011).
  10. Krusienski, D. J., Sellers, E. W., Cabestaing, F., Bayoudh, S., McFarland, D. J., Vaughan, T. M. A comparison of classification techniques for the P300 Speller. Journal of Neural Engineering. 3 (4), 299-305 (2006).
  11. Sellers, E. W., Donchin, E. A P300-based brain-computer interface: initial tests by ALS patients. Clinical Neurophysiology. 117 (3), 538-548 (2006).
  12. Donchin, E., Spencer, K. M., Wijesinghe, R. The mental prosthesis: assessing the speed of a P300-based brain-computer interface. IEEE Transactions on Rehabilitation Engineering. 8 (2), 174-179 (2000).
  13. Höhne, J., Schreuder, M., Blankertz, B., Tangermann, M. A novel 9-class auditory ERP paradigm driving a predictive text entry system. Frontiers in Neuroscience. 5, 99(2011).
  14. Acqualagna, L., Treder, M. S., Blankertz, B. Chroma Speller: Isotropic visual stimuli for truly gaze-independent spelling. 2013 6th International IEEE/EMBS Conference on Neural Engineering (NER), , (2013).
  15. Townsend, G., LaPallo, B. K., Boulay, C. B., Krusienski, D. J., Frye, G. E., Hauser, C. K. A novel P300-based brain-computer interface stimulus presentation paradigm: moving beyond rows and columns. Clinical Neurophysiology. 121 (7), 1109-1120 (2010).
  16. Guger, C., Daban, S., Sellers, E., Holzner, C., Krausz, G., Carabalona, R. How many people are able to control a P300-based brain-computer interface (BCI). Neuroscience Letters. 462 (1), 94-98 (2009).
  17. Mowla, M. R., Gonzalez-Morales, J. D., Rico-Martinez, J., Ulichnie, D. A., Thompson, D. E. A comparison of classification techniques to predict Brain-computer interfaces accuracy using classifier-based latency estimation. Brain Science. 10 (10), 734(2020).
  18. Thompson, D. E., Warschausky, S., Huggins, J. E. Classifier-based latency estimation: a novel way to estimate and predict BCI accuracy. Journal of Neural Engineering. 10 (1), 016006(2012).
  19. Thompson, D. E., Gruis, K. L., Huggins, J. E. A plug-and-play brain-computer interface to operate commercial assistive technology. Disability and Rehabilitation: Assistive Technology. 9 (2), 144-150 (2014).
  20. Korczowski, L., Ostaschenko, E., Andreev, A., Cattan, G., Coelho Rodrigues, P. L., Gautheret, V., Congedo, M. Brain Invaders calibration-less P300-based BCI using dry EEG electrodes Dataset (bi2014a) [Data set]. Zenodo. , (2019).
  21. Krusienski, D. J., Sellers, E. W., Cabestaing, F., Bayoudh, S., McFarland, D. J., Vaughan, T. M., Wolpaw, J. R. A comparison of classification techniques for the P300 Speller. Journal of Neural Engineering. 3 (4), 299-305 (2006).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

P300 SpellerBCI Performance EstimationEEG DatasetLinear RegressionAccuracy PredictionRMSE CalculationFeature ExtractionBrain Invader Data

Related Articles