Abstract
The method of Common Spatial Patterns (CSP) is widely used for feature extraction of electroencephalography (EEG) data, such as in motor imagery brain-computer interface (BCI) systems. It is a data-driven method estimating a set of spatial filters so that the power of the filtered EEG signal is maximized for one motor imagery class and minimized for the other. This method, however, is prone to overfitting and is known to suffer from poor generalization especially with limited calibration data. Additionally, due to the high heterogeneity in brain data and the non-stationarity of brain activity, CSP is usually trained for each user separately resulting in long calibration sessions or frequent re-calibrations that are tiring for the user. In this work, we propose a novel algorithm called Spectrally Adaptive Common Spatial Patterns (SACSP) that improves CSP by learning a temporal/spectral filter for each spatial filter so that the spatial filters are concentrated on the most relevant temporal frequencies for each user. We show the efficacy of SACSP in providing better generalizability and higher classification accuracy from calibration to online control compared to existing methods. Furthermore, we show that SACSP provides neurophysiologically relevant information about the temporal frequencies of the filtered signals. Our results highlight the differences in the motor imagery signal among BCI users as well as spectral differences in the signals generated for each class, and show the importance of learning robust user-specific features in a data-driven manner.
Introduction
In motor imagery (MI) Brain-Computer Interfaces (BCIs), users control external devices by imagining specific movements, such as moving the left or right hand. The efficacy of these systems relies heavily on the extraction of robust features from electroencephalography (EEG) signals. For years, the "gold standard" for this task has been Common Spatial Patterns (CSP).
However, CSP faces two significant challenges that hinder its real-world utility:
- Overfitting: CSP is highly sensitive to noise and typically requires extensive calibration data to generalize well. Collecting this data is often exhausting for the user.
- Frequency Sensitivity: Traditional CSP requires researchers to manually pre-select a frequency band (e.g., 7–30 Hz). Because neural oscillations—specifically the mu and beta rhythms—vary significantly between individuals, a fixed filter often fails to capture the most discriminative information for a specific user, especially when transitioning from offline calibration to real-time online control.
To address these limitations, we introduce Spectrally Adaptive Common Spatial Patterns (SACSP), an algorithm designed to automatically learn user-specific spatial and spectral filters simultaneously.
The SACSP Framework
The core innovation of SACSP is the generalization of the traditional CSP cost function. While standard CSP seeks a spatial projection that maximizes variance for one class relative to another, SACSP introduces a circulant matrix into the covariance estimation. This matrix represents a temporal filter, allowing the model to weight different frequencies during the spatial filter optimization.
Alternating Optimization
Because solving for both spatial weights ($w$) and spectral weights ($h$) simultaneously results in a non-convex optimization problem, SACSP employs an alternating maximization procedure. The algorithm fixes the spectral filter to optimize the spatial weights, then fixes the spatial weights to refine the spectral filter. To avoid local optima, the spectral filters are initialized using three distinct strategies: a flat (all-pass) filter, a mu-band filter (7–15 Hz), and a beta-band filter (15–30 Hz).
Experimental Design
We evaluated SACSP using a custom dataset involving 12 BCI-naive participants. The experimental protocol was divided into two distinct phases:
- Calibration: Participants performed 136 trials of imagined movement to train the models.
- Online Control: Participants performed approximately 272 trials where they used the trained model to move a cursor on a screen in real-time.
We benchmarked SACSP against several established methods: standard CSP, Canonical Correlation Analysis CSP (CCACSP), Spectrally-weighted CSP (spec-CSP), and EEGNet, a compact convolutional neural network designed for EEG.
Key Insights
Data-Driven Frequency Selection
Unlike "filter bank" approaches that use pre-defined sub-bands, SACSP learns the spectral filter directly from the raw data. This allows the model to capture subtle, user-specific frequency shifts that fixed filters often miss, leading to more robust feature extraction.
Neurophysiological Interpretability
One of the most compelling aspects of SACSP is its interpretability. The spectral filters learned by the algorithm naturally peaked in the mu and beta bands. This alignment with known neurophysiological expectations occurred without the model being explicitly forced to target those frequencies, validating that SACSP is identifying biologically relevant signals.
The "Small Data" Advantage
Interestingly, deep learning models like EEGNet performed poorly in this study, yielding results comparable to basic CSP. This highlights a critical limitation of deep learning in clinical or consumer BCI settings: these models typically require massive datasets to generalize. In contrast, SACSP’s structured optimization is highly effective even with the limited calibration data typical of a single-user session.
Results and Performance
SACSP demonstrated superior performance across multiple metrics:
- Accuracy: SACSP achieved an average online classification accuracy of 66%, significantly outperforming CCACSP (63%), spec-CSP (60%), and both standard CSP and EEGNet (58%).
- Statistical Significance: The improvements were statistically significant ($p < 0.01$, Wilcoxon signed-rank test).
- Stability: While standard CSP often shows high accuracy during training but fails during online testing, SACSP maintained its performance, effectively closing the "calibration-to-online gap."
- Efficiency: The algorithm is computationally efficient, converging in seconds, which is vital for practical BCI applications.
Conclusion
SACSP represents a significant step forward in making BCIs more user-friendly and reliable. By automating the selection of both spatial and spectral features, it reduces the burden of manual tuning and improves the system's ability to generalize from short calibration sessions to real-world use. Future work will explore the application of SACSP in transfer learning scenarios and its integration into hybrid BCI systems to further enhance control reliability.
Summary updated