gms | German Medical Science

GMS German Medical Science — an Interdisciplinary Journal

Association of the Scientific Medical Societies in Germany (AWMF)

ISSN 1612-3174

Significance of EEG-electrode combinations while calculating filters with common spatial patterns

Signifikanz von EEG-Elektroden-Kombinationen bei der Berechnung von Filtern mittels Common Spatial Patterns

Research Article Medical Informatics

  • corresponding author Dominik Wetzel - University of Applied Sciences Zwickau, Faculty of Physical Engineering/Computer Sciences, Zwickau, Germany
  • author Paul-Philipp Jacobs - University Leipzig, Department of Diagnostic and Interventional Radiology, Leipzig, Germany
  • author Dirk Winkler - University Leipzig, Department of Neurosurgery, Leipzig, Germany
  • author Ronny Grunert - University Leipzig, Department of Neurosurgery, Leipzig, Germany; Fraunhofer Institute for Machine Tools and Forming Technology, Fraunhofer Plastics Technology Center Oberlausitz, Zittau, Germany

GMS Ger Med Sci 2024;22:Doc08

doi: 10.3205/000334, urn:nbn:de:0183-0003340

Received: June 28, 2023
Revised: February 15, 2024
Published: September 25, 2024

© 2024 Wetzel et al.
This is an Open Access article distributed under the terms of the Creative Commons Attribution 4.0 License. See license information at http://creativecommons.org/licenses/by/4.0/.


Abstract

Objective: Common spatial pattern (CSP) is a common filter technique used for pre-processing of electroencephalography (EEG) signals for imaginary movement classification tasks. It is crucial to reduce the amount of features especially in cases where few data is available. Therefore, different approaches to reduce the amount of electrodes used for CSP calculation are tried in this research.

Methods: Freely available EEG datasets are used for the evaluation. To evaluate the approaches a simple classification pipeline consisting mainly of the CSP calculation and linear discriminant analysis for classification is used. A baseline over all electrodes is calculated and compared against the results of the approaches.

Results: The most promising approach is to use the ability of CSP to provide information about the origin of the created filter. An algorithm that extracts the important electrodes from the CSP utilizing these information is proposed.

The results show that using subject specific electrode positions has a positive impact on accuracy for the classification task. Further, it is shown that good performing electrode combinations in one session are not necessarily good performing electrodes in another session of the same subject. In addition to the combinations calculated using the developed algorithm, 26 additional electrode combinations are proposed. These can be taken into account when selecting well-performing electrode combinations. In this research we could achieve an accuracy improvement of over 10%.

Conclusions: Carefully selecting the correct electrode combination can improve accuracy for classifying an imaginary movement task.

Keywords: algorithms, electroencephalography, statistics

Zusammenfassung

Ziel: Common Spatial Patterns (CSP) ist eine gängige Filtertechnik, die für die Vorverarbeitung von Elektroenzephalographie-Signalen (EEG) zur Klassifizierung gedachter Bewegungen verwendet wird. Besonders in Fällen, in denen nur wenige Daten verfügbar sind, ist es wichtig, die Anzahl der Merkmale zu reduzieren. In dieser Forschungsarbeit werden verschiedene Ansätze zur Reduzierung der Anzahl der für die CSP-Berechnung verwendeten Elektroden untersucht.

Methoden: Frei verfügbare EEG-Datensätze werden für die Evaluierung genutzt. Dazu wird eine einfache Klassifizierungspipeline bestehend aus CSP und linearer Diskriminanzanalyse zur Klassifizierung genutzt. Es wird eine Basislinie unter Nutzung aller Elektroden berechnet und diese mit den Ergebnissen der verschiedenen Ansätze verglichen.

Ergebnisse: Der vielversprechendste Ansatz besteht darin, die Fähigkeit von CSP zu nutzen, Informationen über den Ursprung des erstellten Filters zu liefern. Es wird ein Algorithmus vorgeschlagen, der diese Fähigkeit ausnutzt und so wichtige Elektroden aus dem CSP extrahiert.

Die Ergebnisse zeigen, dass die Verwendung von probandenspezifischen Elektrodenpositionen eine positive Auswirkung auf die Genauigkeit der Klassifizierungsaufgabe hat. Außerdem wird gezeigt, dass Elektrodenkombinationen, die in einem Versuch gut funktionieren, nicht unbedingt auch in einem anderen Versuch desselben Probanden gut abschneiden. Zusätzlich zu den mit Hilfe des entwickelten Algorithmus berechneten Kombinationen werden 26 weitere Elektrodenkombinationen vorgeschlagen. Diese können bei der Auswahl gut funktionierender Elektrodenkombinationen berücksichtigt werden. In dieser Arbeit konnten wir damit eine Verbesserung der Genauigkeit von über 10% erzielen.

Schlussfolgerung: Die sorgfältige Auswahl der richtigen Elektrodenkombination kann die Genauigkeit bei der Klassifizierung von einer gedachten Bewegung verbessern.

Schlüsselwörter: Algorithmen, Elektroenzephalographie, Statistik


Introduction

Common spatial pattern (CSP) is an algorithm which decomposes a signal into spatial patterns that are extracted from multiple classes. These are used to calculate spatial filters that maximize the ratio of the variance of one class to another [1], [2]. It can be utilized to decompose an electroencephalography (EEG) signal into components that separate different classes [1], [2], which in turn can be used to control a brain-computer interface (BCI). BCIs can be used to control different types of hardware and software, such as wheel chairs [3] or an avatar in a virtual reality environment [4]. Integration of BCIs into the rehabilitation therapy of stroke patients is an ongoing research subject [5], [6].

Many variants of CSP exist and are still subject to research [7], [8], [9]. As CSP is used to create signal-specific filters; an interesting characteristic of CSP is the ability to reveal information about the origin of the created filter. This can be utilized to select important features or electrodes for a specific subject [10], [11]. Wang et al. calculate the event-related desynchronization and readiness potential using all electrodes and select only those electrodes that have maximum value based on the computed CSPs [10]. Another approach is omitting channels where the average of the CSP mixing matrix coefficients is less than a certain threshold and evaluate the remaining signals with the help of a neural network [11]. However, the authors did not state the impact on the electrode reduction and did not compare it with other approaches.

In this study, our objective is to identify improved electrode combinations for classifying an imaginary movement (IM) task through the use of CSP. We aim to compare these combinations with CSP calculations incorporating all available electrodes.


Material and methods

In this work two different approaches are proposed:

  • Approach 1: Check every possible combination on one dataset, take the best combinations and try them on the other datasets (to see if some generalization is possible).
  • Approach 2: Infer possible combinations for each subject in each dataset using the patterns from the base CSP calculation.

Another approach would be to try every possible combination for each subject in each dataset and choose the best one. Due to the high computational expense this approach is unfeasible and therefore was discarded.

To acquire the needed data we utilize the library “Mother of all BCI Benchmarks” (MOABB) [12] as it contains interfaces to different freely available BCI datasets. Only datasets that fulfill the following conditions were considered for the evaluation:

  • All sessions in the dataset are recorded with at least 90 Hz sampling rate.
  • The paradigm of the dataset contains at least a left-hand imagination and a right-hand imagination class.
  • The electrodes used for data acquisition contain at least the electrodes used in [13] (see Figure 1 [Fig. 1]).

Four datasets meet these conditions: Yi2014 with n=10 [14], BCI Competition IV Dataset 2a (BNCI2014) with n=9 and 2 sessions per subject [15], Cho2017 with n=49 [16] and PhysioNet with n=109 [17].

We use the EEG data from the datasets with the left-hand imagination and right-hand imagination classes (which consist of single finger or full hand movements). Subsequently we utilized a simple pipeline as shown in Figure 2 [Fig. 2] containing: 1) a preprocessing step, where the data is reduced to the specified electrodes and bandpass filtered between 5 and 45 Hz, 2) predefined cross-validation splits, 3) calculation of the CSP filter for each split and filtering the signal with it using a CSP implementation from MNE-Python [18], 4) a classification step with linear discriminant analysis (LDA) and 5) the combination of the accuracies to a mean accuracy.

Baseline: We perform a baseline calculation with the pipeline utilizing all electrodes for each subject from the dataset (BFull) as well as the pipeline with 16 electrodes that are positioned as shown in Figure 1 [Fig. 1] (B16).

Approach 1: We consider only the 16 electrodes leading to an amount of possible combinations of Equation 1. We choose to only use combinations that contain at least 8 electrodes to have enough features for LDA after the CSP filter, which results in Equation 2 combinations. Further we decided to use Yi2014 as base dataset as it is fast to calculate for each combination. We run the pipeline for all combinations on each subject of Yi2014. The percentage change between the 16 electrode baseline accuracy (of Yi2014) and each combination’s accuracy is calculated afterwards. Last, we assess whether the expectation µ is significant better over all subjects for each combination using a t-test with the following hypothesis:

(1) H0:µ≤0, Ha:µ>0 and α=5%

Significant combinations are used for processing the other datasets.

Approach 2: We developed an algorithm to infer more useful electrodes by using the CSP calculation from the baselines. Therefore, we use the pattern p from the first 8 CSP components [the amount of components calculated with CSP is the amount of electrodes, but we only consider the first 8 as the latter are less significant] and select the electrodes that fulfill the following condition:

(2) |epEquation 3|>θ·σ(p)

where ep is the value of the electrode in the pattern p, Equation 3 is the mean of all electrode values of the pattern, θ is a predefined threshold and σ(p) is the standard deviation of all electrode values of the pattern. In our experiments we set θ=1.5. Figure 3 [Fig. 3] shows a visualization of the algorithm.

We calculate the electrodes for each cross validation split. The found electrode combinations (containing more than 2 electrodes) are then used to calculate the accuracy for the subject and the combination with the highest accuracy is furthermore compared against the baselines. The complete pipeline is visualized in Figure 4 [Fig. 4].


Evaluation

To evaluate our approaches we perform Bayesian A/B tests [19], [20]. We compare different variants against the full electrode baseline (BFull). The used variants are:

  • The 16 electrode baseline (B16)
  • The best electrode combinations from approach 1 (A1)
  • The per subject best electrode combinations using our algorithm with 16 electrode base (Algo16)
  • The per subject best electrode combinations using our algorithm with full electrode base (AlgoFull)
  • The per subject best electrode combinations of the combinations from approach 1 (PSA1)
  • The per subject best electrode combinations of the combinations from approach 1 and our algorithm (both bases) (Comb)

We use the beta distribution for our prior and posterior distribution as we have dichotomic data.

Further we assume a priori that all variants perform better than average so we set α=6 and β=4. However the prior has a marginal effect due to the amount of samples provided. Afterwards we perform a Monte-Carlo simulation with n=10,000 for our variants and calculate the fraction of each variant against the full electrode baseline. By calculating the mean of these fractions we get a percentual improvement against BFull.


Results

After testing all combinations on Yi2014, 26 remain as significant over all 10 subjects from Yi2014. Applying those combinations separately on the other datasets did not lead to improvements of the accuracy compared to BFull (see Table 1 [Tab. 1] and A1 in Table 2 [Tab. 2]), whereas using only the best of all 26 combinations for each subject individually increases the accuracy significantly (see PSA1 in Table 2 [Tab. 2]). Using the proposed algorithm improves accuracy compared to BFull, but it is not as effective as PSA1 (see Algo16 and AlgoFull in Table 2 [Tab. 2]). Interestingly combining the different approaches leads to an improvement of more than 10% (see Comb in Table 2 [Tab. 2]).

These findings are also visualized in Figure 5 [Fig. 5], which shows the computed beta distributions of where the samples are taken from for the percentual improvement calculation.

As BNCI2014 contains 2 sessions per subject, we test whether a good performing combination in one session also improves the accuracy for the other session. Figure 6 [Fig. 6] shows the result for subject 1 and 3. It is obvious that a combination which works well for one session may not perform equally well in another session.


Discussion

Our results show that using only specific electrodes has the potential to increase the accuracy of an IM task compared to using all electrodes (as also shown in [21]). Reducing the amount to a predefined number of electrodes (from all to 16) does not lead to better results. We also showed that even for the same subject the calculated electrode combination cannot be transferred to another session. In summary, it can be seen that it is important to calculate a well-performing electrode combination for each session and subject so that the overall amount of electrodes applied to the subject cannot be reduced, but the evaluation speed and accuracy of an IM task can. The proposed algorithm for determining good performing electrode combinations can be used even in a clinical setting, as it is fast to calculate and EEG tasks usually need calibration anyway. Furthermore, we proposed 26 electrode combinations that can be considered additionally for better performance. In summary, sophisticated selection of the appropriate electrode combination can enhance the accuracy of an IM task. In our research we achieved an improvement of over 10%.

To further improve performance the algorithm to detect electrode combinations could be revised or changed as there are subjects where it performs worse. It was assumed that this is due to a low amount of channels. However, there is no correlation between the number of channels and the percentage of change. Another step could be to determine another set of well-performing electrode combinations using the brute-force calculation (approach 1) on another dataset and compare it to the shown results.


Notes

Source code

The source code for this research is available at https://gitlab.com/domwet/csp-research.git.

Datasets

Competing interests

The authors declare that they have no competing interests.


References

1.
Ramoser H, Müller-Gerking J, Pfurtscheller G. Optimal spatial filtering of single trial EEG during imagined hand movement. IEEE Trans Rehabil Eng. 2000 Dec;8(4):441-6. DOI: 10.1109/86.895946 External link
2.
Grosse-Wentrup M, Buss M. Multiclass common spatial patterns and information theoretic feature extraction. IEEE Trans Biomed Eng. 2008 Aug;55(8):1991-2000. DOI: 10.1109/TBME.2008.921154 External link
3.
Galán F, Nuttin M, Lew E, Ferrez PW, Vanacker G, Philips J, Millán Jdel R. A brain-actuated wheelchair: asynchronous and non-invasive Brain-computer interfaces for continuous control of robots. Clin Neurophysiol. 2008 Sep;119(9):2159-69. DOI: 10.1016/j.clinph.2008.06.001 External link
4.
Vourvopoulos A, Pardo OM, Lefebvre S, Neureither M, Saldana D, Jahng E, Liew SL. Effects of a Brain-Computer Interface With Virtual Reality (VR) Neurofeedback: A Pilot Study in Chronic Stroke Patients. Front Hum Neurosci. 2019 Jun 19;13:210. DOI: 10.3389/fnhum.2019.00210 External link
5.
Soekadar SR, Birbaumer N, Slutzky MW, Cohen LG. Brain-machine interfaces in neurorehabilitation of stroke. Neurobiol Dis. 2015 Nov;83:172-9. DOI: 10.1016/j.nbd.2014.11.025 External link
6.
Wetzel D, Winterlich J, Schaal T. Rehabilitation after Stroke: Practicable Functionalities and Benefiting Patients of Brain- computer Interfaces in Combination with Functional Electrical Stimulation - A Qualitative Interview Study. Int J Sci Stud. 2022;10(4):54-8. Available from: https://www.ijss-sn.com/uploads/2/0/1/5/20153321/12_ijss_jul_22_oa11_-_2022.pdf External link
7.
Xygonakis I, Athanasiou A, Pandria N, Kugiumtzis D, Bamidis PD. Decoding Motor Imagery through Common Spatial Pattern Filters at the EEG Source Space. Comput Intell Neurosci. 2018 Aug 1;2018:7957408. DOI: 10.1155/2018/7957408 External link
8.
Zahid SZ, Aqil M, Tufail M, Nazir MS. Online Classification of Multiple Motor Imagery Tasks Using Filter Bank Based Maximum-a-Posteriori Common Spatial Pattern Filters. IRBM. 2020;41(3):141-50. DOI: 10.1016/J.IRBM.2019.11.002 External link
9.
Blanco-Diaz CF, Antelis JM, Ruiz-Olaya AF. Comparative analysis of spectral and temporal combinations in CSP-based methods for decoding hand motor imagery tasks. J Neurosci Methods. 2022 Apr 1;371:109495. DOI: 10.1016/j.jneumeth.2022.109495 External link
10.
Wang Y, Gao S, Gao X. Common Spatial Pattern Method for Channel Selelction in Motor Imagery Based Brain-computer Interface. Conf Proc IEEE Eng Med Biol Soc. 2005;2005:5392-5. DOI: 10.1109/IEMBS.2005.1615701 External link
11.
Nouri A, Ghanbari Z, Aslani MR, Moradi MH. A new approach to feature extraction in MI-based BCI systems. In: Bajaj V, Sinha GR, editors. Artificial Intelligence-Based Brain-Computer Interface. London: Academic Press; 2022. p. 75-98. DOI: 10.1016/B978-0-323-91197-9.00002-3 External link
12.
Jayaram V, Barachant A. MOABB: trustworthy algorithm benchmarking for BCIs. J Neural Eng. 2018 Dec;15(6):066011. DOI: 10.1088/1741-2552/aadea0 External link
13.
Wetzel D, Spahn N, Heilemann M, Löffler MM, Seidel M, Kolbig S, Winkler D. Evaluation of electroencephalography analysis methods. Annu Int Conf IEEE Eng Med Biol Soc. 2019 Jul;2019:767-73. DOI: 10.1109/EMBC.2019.8857230 External link
14.
Yi W, Qiu S, Wang K, Qi H, Zhang L, Zhou P, He F, Ming D. Evaluation of EEG oscillatory patterns and cognitive process during simple and compound limb motor imagery. PLoS One. 2014 Dec 9;9(12):e114853. DOI: 10.1371/journal.pone.0114853 External link
15.
Tangermann M, Müller KR, Aertsen A, Birbaumer N, Braun C, Brunner C, Leeb R, Mehring C, Miller KJ, Müller-Putz GR, Nolte G, Pfurtscheller G, Preissl H, Schalk G, Schlögl A, Vidaurre C, Waldert S, Blankertz B. Review of the BCI Competition IV. Front Neurosci. 2012 Jul 13;6:55. DOI: 10.3389/fnins.2012.00055 External link
16.
Cho H, Ahn M, Ahn S, Kwon M, Jun SC. EEG datasets for motor imagery brain-computer interface. Gigascience. 2017 Jul 1;6(7):1-8. DOI: 10.1093/gigascience/gix034 External link
17.
Goldberger AL, Amaral LA, Glass L, Hausdorff JM, Ivanov PC, Mark RG, Mietus JE, Moody GB, Peng CK, Stanley HE. PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation. 2000 Jun 13;101(23):E215-20. DOI: 10.1161/01.cir.101.23.e215 External link
18.
Gramfort A, Luessi M, Larson E, Engemann DA, Strohmeier D, Brodbeck C, Parkkonen L, Hämäläinen MS. MNE software for processing MEG and EEG data. Neuroimage. 2014 Feb 1;86:446-60. DOI: 10.1016/j.neuroimage.2013.10.027 External link
19.
Bayes T, Price R. LII. An essay towards solving a problem in the doctrine of chances. By the late Rev. Mr. Bayes, F. R. S. communicated by Mr. Price, in a letter to John Canton, A. M. F. R. S. Philos Trans R Soc Lond. 1763;53:370-418. DOI: 10.1098/rstl.1763.0053 External link
20.
Kruschke JK. Bayesian estimation supersedes the t test. J Exp Psychol Gen. 2013 May;142(2):573-603. DOI: 10.1037/a0029146 External link
21.
Lal TN, Schröder M, Hinterberger T, Weston J, Bogdan M, Birbaumer N, Schölkopf B. Support vector channel selection in BCI. IEEE Trans Biomed Eng. 2004 Jun;51(6):1003-10. DOI: 10.1109/TBME.2004.827827 External link
22.
Yi W. EEG data of simple and compound limb motor imagery. V1. Harvard Dataverse; 2014. DOI: 10.7910/DVN/27306 External link
23.
Brunner C, Leeb R, Müller-Putz G. BCI Competition 2008–Graz data set A. IEEE DataPort. DOI: 10.21227/katb-zv89 External link
24.
Cho H, Ahn M, Ahn S, Kwon M, Jun SC. Supporting data for "EEG datasets for motor imagery brain computer interface". GigaScience Database; 2017. DOI: 10.5524/100295 External link
25.
Schalk S, Sarnacki WA, Joshi A, McFarland DJ, Wolpaw JR. EEG Motor Movement/Imagery Dataset. PhysioNet; 2009. DOI: 10.13026/C28G6P External link
26.
Oxley BC. International 10-20 system for EEG-MCN.svg. Wikimedia Commons; 2017 Jul 11. Available from: https://commons.wikimedia.org/wiki/File:International_10-20_system_for_EEG-MCN.svg External link