Abstract
Brain–computer interfaces using motor imagery (MI-BCIs) offer a promising noninvasive communication pathway between humans and engineered equipment such as robots. However, for MI-BCIs based on electroencephalography (EEG), the reliability of the interface across recording sessions is limited by temporal non-stationary effects. Overcoming this barrier is critical to translating MI-BCIs from controlled laboratory environments to practical uses. In this paper, we present a comprehensive dual-validation framework to rigorously evaluate the temporal robustness of EEG signals of an MI-BCI. We collected data from six participants performing four motor imagery tasks (left/right hand and foot). Features were extracted using Common Spatial Patterns, and ten machine learning classifiers were assessed within a unified pipeline. Our method integrates within-session evaluation (stratified K-fold cross-validation) with cross-session testing (bidirectional train/test), complemented by stability metrics and performance heterogeneity assessment. Findings reveal minimal performance loss between conditions, with an average accuracy drop of just 2.5%. The AdaBoost classifier achieved the highest within-session performance (84.0% system accuracy, F1-score: 83.8%/80.9% for hand/foot), while the K-nearest neighbors (KNN) classifier demonstrated the best cross-session robustness (81.2% system accuracy, F1-score: 80.5%/80.2% for hand/foot, 0.663 robustness score). This study shows that robust performance across sessions is attainable for MI-BCI evaluation, supporting the pathway toward reliable, real-world clinical deployment.
1. Introduction
1.1. Background and Motivation
Brain–computer interfaces using motor imagery (MI-BCIs) show great promise for assistive devices and neurorehabilitation [1,2,3]. While past studies, including our own, demonstrated the feasibility of classifying multiple motor imagery tasks with machine learning [4,5]. However, validation methods proposed were insufficient for predicting real-world performance. This study addresses this limitation with a comprehensive cross-session analysis to better evaluate the BCI’s practical potential.
A major challenge for BCI deployment is that EEG signals are unstable and change over time, even though single-session tests may look promising [6,7]. This instability is a known problem for MI-BCIs, as neural patterns often differ between sessions [8,9,10]. Therefore, the BCI’s reliability and usability suffer in real-world applications where users cannot afford poor performance or the need for frequent recalibration.
Our previous paper [4] showed successful motor imagery classification, but its reliance on within-session testing likely overestimated its real-world performance. The main limitations were (1) no cross-session validation to check performance over time, (2) a lack of metrics for clinical usefulness, (3) limited analysis of how performance varied across subjects and tasks, and (4) no assessment of the system’s efficiency.
The present paper addresses the limitations of past work through a systematic dual-validation framework that systematically compares within-session and cross-session performance, providing a comprehensive assessment of laboratory-to-practice performance degradation in MI-BCIs. The framework integrates advanced statistical analysis with clinical translation metrics to establish evidence-based guidelines for BCI deployment readiness assessment.
1.2. Literature Review and Extended Research Context
Recent BCI research stresses that cross-session validation is crucial for reliable testing [3,8,11], because system performance often drops significantly when tested across different sessions [6,7]. For example, one longitudinal study [12], preparing a pilot for the CYBATHLON BCI Race, reported a substantial performance drop during the competition. The pilot’s race time worsened from an average of 120 s in training to 196 s in the official run, a performance degradation of over 60%. This failure happened because the EEG feature distribution changed, making the classifier unreliable. This shows a significant gap between encouraging lab results and practical use in real-world situations.
Deep learning approaches have shown promise for EEG-based BCIs [13,14,15]. Recent work specifically targeting cross-session robustness includes (1) domain adaptation networks that align feature distributions across sessions [10,16], achieving 5–8% improvement in cross-session accuracy over baseline deep learning; (2) meta-learning frameworks that enable rapid adaptation to new sessions with limited calibration data [17,18]; and (3) transformer-based architectures leveraging self-attention to learn session-invariant representations [19,20,21]. However, these deep learning methods face significant challenges in BCI contexts: (a) requirement for large training datasets (often >1000 trials per subject), limiting feasibility for clinical populations [22]; (b) computational complexity precluding real-time embedded deployment, even when advanced models are adapted [23]; (c) lack of interpretability complicating clinical validation and regulatory approval [24]; and (d) vulnerability to catastrophic forgetting when fine-tuned across sessions, a core issue in continual learning [25].
In contrast, traditional machine learning with domain-specific feature extraction (e.g., CSP) offers complementary advantages for cross-session robustness [3,4,26]: interpretable spatial filters aligned with neurophysiological principles, efficient performance with limited data (<200 trials), real-time computational feasibility, and stable performance without catastrophic forgetting. Methods such as Common Spatial Patterns (CSPs) and ensemble classifiers continue to be effective and practical for clinical applications [27,28,29]. For instance, a recent study introduced an advanced Superimposed Filter Bank Common Spatial Pattern (SFB-CSP) method paired with SVM, improving cross-session accuracy over conventional approaches [30]. Another work developed a advanced CSP variant combined with LDA to significantly reduce calibration effort for new BCI users [31]. While deep learning may ultimately achieve superior cross-session performance with sufficient data, traditional ML methods currently provide a more pragmatic balance of robustness, interpretability, and clinical feasibility for moderate-scale studies like ours.
New assistive BCI technologies show promise for clinical use [1,5,32]. Motor imagery systems have been successfully applied in therapy and communication. However, a common weakness in existing research is the focus on within-session validation. This approach does not evaluate the system’s long-term stability. Advanced methods such as subject-independent classification [33] and multimodal analysis [34] are expanding the potential for creating reliable clinical BCI systems.
1.3. Key Contributions
This work introduces several key contributions to the BCI field:
- Dual-validation framework: A comprehensive methodology comparing within-session and cross-session performance.
- Temporal robustness quantification: Systematic assessment of laboratory-to-practice performance degradation.
- Clinical translation metrics: Integration of comprehensive performance analysis and deployment readiness assessment.
- Statistical rigor enhancement: Advanced significance testing with effect sizes and multiple comparison corrections.
- Task-specific stability analysis: Comprehensive comparison of hand versus foot imagery temporal robustness.
The primary objective of this study is to establish comprehensive validation standards for MI-BCIs that bridge the gap between laboratory research and practical deployment, with specific emphasis on temporal robustness and clinical translation readiness [32].
2. Materials and Methods
2.1. Participants and Experimental Protocol
Six healthy adults (age: years, four males, two females) participated in this study; no inclusion or exclusion criteria were present, and all subjects participated at their own discretion. All participants provided written informed consent and participated voluntarily without compensation. The experimental protocol was extended from our previous work [4] to include 3 sessions with 40 motor imagery tasks per session (10 of each task). The sessions were spaced 1–2 days apart, and the experimental paradigm is illustrated in Figure 1. This inter-session interval was chosen to evaluate performance degradation while minimizing practice effects. The tasks (left-hand clench, right-hand clench, left-foot plantar flexion, right-foot plantar flexion) were randomly presented to the subject while EEG data was being recorded by a Python program (v3.12).
Figure 1.
The experimental paradigm. The top panel shows the timing of a single trial, including a 2 s planning phase, a 2 s motor imagery window, and a 2 s resting phase. The bottom panels display the visual cues presented to the user for each of the four tasks and the 10–20-EEG-electrode layout used for data acquisition.
Each task lasted 2 s, with 2 s to rest, and 2 s preceding it for planning. Visual cues for each task were displayed on a monitor, and participants were instructed to maintain focus on the imagery without physical movement.
Although the current experiment focuses on four canonical motor imagery (MI) tasks, the proposed framework is not limited to this set. The data acquisition and processing pipeline was designed to be universal, allowing the addition of other MI tasks without needing to modify the underlying architecture. The pipeline is designed to be modular, and components can be tweaked to design many other MI paradigms. This extensibility is important for developing subject-specific or task-adaptive BCI systems, where the MI tasks can vary based on the specific application or use case. Future work will build on the current framework to add more MI tasks and move toward a continuous BCI paradigm.
2.2. EEG Data Acquisition and Processing
We recorded EEG signals at 125 Hz using a 16-channel OpenBCI Cyton Daisy system (OpenBCI, Brooklyn, NY, USA) [35]. Following the international 10–20 system, we placed electrodes over sensorimotor areas, including C3, C4, and surrounding locations. The ground electrode was placed at Fz. This configuration was chosen because it was effective in our prior work [4,5,36]. The complete experimental setup and data processing pipeline are shown in Figure 2.
Figure 2.
The experimental and data processing workflow (adapted from [4]). The process begins with equipment setup and impedance checking, followed by the experiment demonstration and data acquisition. The acquired signals are then processed through an FIR filter, segmented based on trial timing and task labels, and subjected to spectral selection and feature extraction before classification.
The segmentation step shown in Figure 2 serves to divide the continuous EEG stream into distinct temporal windows based on the experimental protocol timing. Specifically, segmentation extracts the 2-second motor imagery execution windows (250 samples at 125 Hz) corresponding to each trial, labeled with their respective phase (planning, execution, resting) and the four MI tasks (left/right hand/foot). Each trial is two seconds long and labeled before being processed in the classification pipeline. This ensures that the neural activity of the two seconds is isolated, removing irrelevant data.
2.2.1. EEG Data Acquisition
- EEG Signal Scaling:
- The process of converting the raw OpenBCI analog-to-digital converter (ADC) values into meaningful microvolts (), including the mathematical scaling transformation and the hardware-derived scale factor (SF), is detailed in Supplementary Section S1 [35]. This ensures proper signal amplitude representation for subsequent processing stages.
- Data Stream Organization:
- The consolidated multi-channel data stream is structured aswhere contains channels of scaled EEG data, contains M metadata channels (trial labels, timestamps), and N is the number of temporal samples (). Additional details on data array structure and storage format are provided in Supplementary Section S1.
2.2.2. Signal Processing and Feature Extraction
The EEG signal preprocessing employs a mathematical framework consisting of the following components:
- Digital Bandpass Filtering:
- A finite impulse response (FIR) bandpass filter was applied using the discrete convolutionwhere is the filter coefficients, is the raw EEG signal, is the filtered output, and L is the filter length (number of taps). For the preprocessing bandpass, the automatic FIR design produced taps for a 4–30 Hz passband using a Hamming window. The design employed a minimum-phase realization to reduce latency. Parameter choices align with established BCI practice [37,38].
- Covariance Matrix Estimation:
- For each motor imagery class c, the spatial covariance matrix is computed as [37]where is the i-th trial matrix with C channels and T time samples, and is the number of trials for class c.
- Common Spatial Patterns (CSP):
- It is a supervised spatial filtering technique widely used to enhance class separability in MI EEG analysis, designed to optimally enhance class separability for binary classification problems [37,39]. Its core purpose is to find spatial filters that maximize the variance for one class of EEG signals while simultaneously minimizing it for the other, thus pulling the two classes apart and making them easier to distinguish.Before applying CSP, each segmented trial undergoes additional narrowband spectral filtering to isolate motor imagery rhythms. This feature-extraction stage employs a two-pass FIR filtering within the target band (e.g., 5–13 Hz to emphasize the -rhythm): first with a Hamming window, and then with a Hann window applied to the initial Hamming-filtered signal. This sequential windowing emphasizes sensorimotor rhythms while preserving reproducibility.In our dual-binary architecture (Section 2.3.1), CSP is applied separately to two binary problems: (1) left- vs. right-hand imagery, and (2) left- vs. right-foot imagery. CSP operates on a simple but effective principle: it identifies spatial patterns that maximize the variance for one class while minimizing it for the other. This process effectively pulls the two classes apart in the data, making it easier to distinguish between them.Mathematically, for a given binary problem, CSP solves the following generalized eigenvalue problem:where and represent the covariance matrices of the two classes. Their sum captures the total variance across both classes. The solution yields a matrix of spatial filters, , and their corresponding eigenvalues . To prevent any bias caused by variations in signal strength across different trials, each trial’s covariance matrix was normalized by its trace (i.e., ) before the decomposition. This ensures that the algorithm focuses on the spatial patterns themselves rather than the signal amplitude.The eigenvectors within are ordered by their corresponding eigenvalues . The filters that provide the greatest discrimination between the two classes are those corresponding to the largest and smallest eigenvalues. Consequently, the first and last m eigenvectors are typically selected as the optimal spatial filters.
- Spatial Filtering and Variance Computation:
- For each trial , the spatially filtered signal is computed aswhere contains the projected signals. The normalized variance features are then extracted:where is the i-th filtered signal, and is a regularization term to prevent numerical instability. The logarithmic variance of the projected signals serves as the feature vector. With spatial filters per class, this yields a feature vector for each trial in each binary classifier (hand and foot), representing the overall discriminative power of the CSP projection.
2.3. Machine Learning Classification Framework
We evaluated 10 machine learning classifiers to provide a comprehensive performance comparison, including
- Support Vector Machine (SVM) with RBF kernel;
- Gaussian Naive Bayes(GNB);
- Random Forest (RF) with 100 estimators;
- K-nearest neighbors (KNN) with k = 5;
- Decision tree (DT) with maximum depth 10;
- Gradient Boosting (GB) with 100 estimators;
- AdaBoost (AB) with 50 estimators;
- Logistic regression (LR) with L2 regularization;
- Multi-Layer Perceptron (MLP) with two hidden layers;
- Linear Discriminant Analysis (LDA).
Hyperparameter optimization was performed with 5-fold cross-validation to ensure optimal performance for each classifier while preventing overfitting.
2.3.1. Dual-Binary Classification Architecture
The system processes EEG signals using a dual-binary classification architecture to generate distinct control commands. This architecture uses two specialized, independent classifiers to optimize performance for each limb modality, extending our previous work on multi-class motor imagery systems [4]. This approach aligns with recent advances in adaptive neural network architectures for BCI applications [40,41], providing robust control signals for assistive technologies.
- Hand Classifier: Trained to distinguish between left- and right-hand motor imagery.
- Foot Classifier: Trained to differentiate between left- and right-foot motor imagery.
This modular approach ensures specialized performance for each limb-specific task, and allows for independent evaluation and optimization of hand and foot motor imagery classification. This strategy is preferred because it leverages the neurophysiological segregation of hand and foot motor areas [38], preventing interference between modalities. Furthermore, it offers a natural mapping to orthogonal control functions in assistive devices and permits modular retraining of individual limb classifiers if performance degrades.
2.3.2. Binary Classifier Implementation and Training
Each binary classifier was implemented using the same machine learning algorithms evaluated in the main study (SVM, KNN, Random Forest, etc.). The specialized training enables focused learning on limb-specific discriminative features:
- training: {Left Fist Clench} vs. {Right Fist Clench};
- training: {Left Foot Flexion} vs. {Right Foot Flexion}.
This dual-system architecture offers several advantages over traditional single-classifier methods:
- Specialized Performance: Each classifier focuses exclusively on its respective motor imagery modality (hand or foot).
- Independent Optimization: Hand and foot classifiers can be optimized separately for maximum performance.
- Modular Design: Individual classifiers can be retrained and updated independently.
- Focused Evaluation: Enables separate analysis of hand and foot imagery classification performance.
- Simplified Control Logic: Direct mapping from classifier output to robot commands without complex decision trees.
- Robust Mapping: Natural correspondence between specific limb movements and robot actions.
For both logistic regression and MLP, the logistic sigmoid is used to compute posterior probabilities:
where and b are the learned parameters for the positive class and is the feature vector. For other classifiers, probabilities are estimated using model-specific approaches: KNN uses class frequency among neighbors; and tree-based models (Random Forest, AdaBoost) use the proportion of votes or class probabilities at the leaves.
The confidence of each independent classifier is then computed as:
where and represent the posterior probabilities for hand and foot classifiers, respectively. These confidence values determine the final output command sent to the external device.
2.4. Dual-Validation Framework
The core methodological contribution of this extended work is the dual-validation framework that systematically compares within-session and cross-session performance.
2.4.1. Within-Session Validation
Within-session validation employed a stratified 5-fold cross-validation to establish baseline laboratory performance under controlled conditions. This methodology provides optimistic performance estimates with minimal temporal variation. The stratified k-fold partitioning preserves class distribution integrity across validation sets [42]:
where each fold maintains the original class proportion for class c, ensuring representative sampling across all motor imagery conditions.
The within-session validation error quantifies model performance under optimal laboratory conditions:
where represents the model trained on all folds except fold i, and denotes the 0–1 loss function, defined as . A fixed random state of 42 was applied to ensures reproducible fold generation across experimental runs.
The optimal hyperparameter selection employs nested cross-validation to prevent overfitting and ensure generalizability [42]:
where represents the hyperparameter search space, denotes the model parameterized by , and is the validation subset within fold i. The scoring function Score is defined as the mean accuracy across validation folds. This approach provides unbiased performance estimates while optimizing model parameters for maximum classification accuracy.
2.4.2. Cross-Session Validation
Cross-session validation implemented a bidirectional train–test paradigm to assess temporal robustness and quantify real-world performance degradation. This approach addresses the critical limitation of within-session validation by evaluating model performance across temporally separated recording sessions, thereby simulating realistic deployment conditions where neural patterns may exhibit non-stationarity.
For each subject with n recording sessions, the methodology performs cross-session evaluations, systematically training models on individual sessions and testing on all remaining sessions. This exhaustive approach provides a comprehensive assessment of temporal generalizability and identifies session-specific performance variations that impact practical BCI deployment. The session permutation generation creates all possible bidirectional training–testing combinations:
where represents the complete set of recording sessions, and denotes the total number of cross-session evaluations per subject. This comprehensive enumeration ensures statistical robustness and captures bidirectional temporal effects.
The cross-session validation error quantifies performance degradation due to temporal non-stationarity [8,9,10]:
where represents the model trained exclusively on session , denotes the test data from session , and is the loss function. This metric directly quantifies the laboratory-to-practice performance gap.
2.4.3. Performance Ranking System
To compare classifiers, we use a ranking system based on the mean of accuracy and F1-score for each classifier:
where represents the value of metric m (either accuracy or F1-score) for classifier c, and is the weight assigned to each metric. In our implementation, equal weights are typically used (i.e., )
2.4.4. Performance Comparison Metrics
Performance was assessed using the following metrics: system accuracy, accuracy degradation, coefficient of variation (CV) for stability, and a composite robustness score. Each metric is defined below.
- System accuracy: A combined accuracy metric representing overall classifier performance across both motor imagery tasks:where Hand Accuracy and Foot Accuracy represent the classification accuracies for left/right-hand and left/right-foot motor imagery tasks, respectively. This metric provides a comprehensive performance assessment for the dual-binary classification system and serves as the basis for temporal stability calculations.
- Accuracy degradation: The percentage difference between within-session and cross-session system accuracy:where is the within-session system accuracy and System is the cross-session system accuracy.
- Stability metrics: Coefficient of Variation (CV) across validation folds / sessions:where is the standard deviation and is the mean accuracy across folds or sessions.
- Robustness scoring: Combined performance stability quantification:where is the mean accuracy and is the coefficient of variation normalized to [0, 1].
2.5. Statistical Analysis
To ensure methodological rigor, a multi-tiered statistical framework was implemented. It focused on three objectives: assessing data distribution, quantifying performance differences, and determining practical significance.
The framework included Shapiro–Wilk tests for normality, which justified the use of a non-parametric approach. Specifically, these tests indicated a non-normal distribution for within-session data (p = 0.001), while cross-session data approached normality (p = 0.142). Based on this, Wilcoxon signed-rank tests were used for paired comparisons between validation methods. Additionally, Cohen’s d was calculated to quantify the effect size, providing an assessment of practical significance beyond simple statistical significance.
3. Results and Discussion
3.1. Performance Evaluation
The dual-validation framework evaluation revealed consistently high classification performance across all machine learning algorithms. Table 1, Table 2 and Table 3 present the accuracy, F1-score, precision, recall, and temporal robustness assessment.
Table 1.
Comprehensive classifier performance analysis.
Table 2.
Detailed performance analysis: F1-score, precision, and recall metrics.
Table 3.
Comprehensive stability and robustness metric comparison.
3.1.1. Within-Session Performance Analysis
Within-session validation demonstrated consistently high performance across all classifiers and motor imagery tasks. AdaBoost achieved the highest system accuracy at 84.0%, followed closely by KNN at 83.3% and MLP at 83.2% (Table 1). The performance range extended from 73.1% (LDA) to 84.0% (AdaBoost), indicating robust classification capabilities across diverse algorithmic approaches. The within-session evaluation provides baseline performance under controlled laboratory conditions with minimal temporal variation between training and testing data.
Detailed performance metric analysis (Table 2) reveals balanced precision–recall characteristics. F1-scores closely matched accuracy values (correlation r > 0.95), confirming stable discriminative capabilities. KNN demonstrated exceptional performance in hand imagery classification (F1: 85.1%), while AdaBoost excelled in foot imagery tasks (F1: 80.9%). The minimal variance between precision and recall metrics (typically <2%) validates the reliability of classification performance across both motor imagery modalities.
3.1.2. Cross-Session Performance Analysis
Cross-session validation revealed remarkably stable temporal performance, with minimal degradation from within-session conditions. AdaBoost and KNN emerged as top performers, achieving system accuracies of 81.4% and 81.2%, respectively (Table 1). The cross-session performance range spanned from 74.2% (LDA) to 81.4% (AdaBoost), demonstrating robust temporal generalization capabilities that challenge conventional expectations about motor imagery BCI stability.
Comprehensive cross-session evaluation maintained classification quality across all performance metrics (Table 2). The correlation between accuracy and F1-scores remained high (r > 0.95), indicating preserved balance between precision and recall under temporal variations. KNN showed exceptional stability with minimal degradation in precision (hand: 83.6%, foot: 83.2%) and recall (hand: 81.2%, foot: 81.1%), confirming its robustness for practical BCI deployment.
3.2. Temporal Robustness Analysis
The laboratory-to-practice performance comparison revealed minimal degradation from within-session to cross-session validation, with an average system accuracy reduction of only 2.5% across all classifiers (Table 1). This finding challenges conventional expectations about temporal robustness in BCIs and suggests greater stability than previously assumed [8]. This minimal laboratory-to-practice performance gap represents a significant advancement toward practical BCI deployment.
KNN and MLP demonstrated exceptional temporal stability with degradation of just 2.6% and 2.7%, respectively. A detailed stability and robustness assessment (Table 3) provides a comprehensive temporal consistency evaluation through coefficient of variation and composite robustness scores. In cross-session validation, KNN achieved the highest robustness score (0.663), followed closely by AdaBoost (0.659) and MLP (0.653). This robustness scoring framework combines accuracy and stability metrics to assess readiness for clinical deployment. This analysis confirms that KNN, AdaBoost, and MLP show exceptional suitability for practical BCI applications, where temporal stability is crucial for reliable operation.
3.3. Task-Specific Performance and Statistical Analysis
Task-specific analysis revealed balanced performance between hand and foot imagery classification across temporal conditions (Figure 3). Hand imagery demonstrated slightly higher precision (76–82% cross-session range) compared to foot imagery (72–81% range), while both modalities maintained stable classification quality under temporal variations.
Figure 3.
Task-specific performance comparison. The plots show within-session and cross-session accuracy for hand vs. foot imagery, and the accuracy degradation from within- to cross-session validation across different classifiers.
Comprehensive cross-session performance evaluation demonstrates consistent temporal robustness across all classification metrics. Accuracy analysis (Figure 4) reveals minimal performance degradation between hand and foot imagery tasks. F1-score distributions (Figure 5) confirm balanced precision–recall trade-offs across temporal domains. Precision assessment (Figure 6) demonstrates reliable positive predictive values, while recall analysis (Figure 7) validates consistent sensitivity across test sessions. This comprehensive metric evaluation supports the deployment readiness of identified robust classifiers for clinical BCI applications.
Figure 4.
Cross-session accuracy comparison between hand and foot motor imagery classification. The boxplots display accuracy distributions across different test sessions for each classifier, demonstrating temporal robustness and task-specific performance patterns.
Figure 5.
Cross-session F1-score comparison between hand and foot motor imagery classification. The visualization demonstrates the balanced precision–recall trade-off across different classifiers and test sessions, providing insights into overall classification quality and temporal consistency.
Figure 6.
Cross-session precision comparison between hand and foot motor imagery classification. The boxplots show the positive predictive value distributions across classifiers and sessions, indicating the reliability of positive classifications in temporal robustness assessment.
Figure 7.
Cross-session recall comparison between hand and foot motor imagery classification. The visualization displays sensitivity distributions across different test sessions, demonstrating the ability to correctly identify positive cases and temporal stability of true-positive detection rates.
Statistical validation using Shapiro–Wilk tests confirmed non-normal distributions (p < 0.001), justifying non-parametric analysis. Wilcoxon signed-rank tests revealed statistically significant differences between validation approaches (p = 0.010) with medium effect size (Cohen’s d = 0.606). The combination of statistical significance with minimal practical degradation (2.5% average) provides strong evidence for temporal robustness, validating the clinical relevance of findings for motor imagery BCI deployment.
3.4. Limitations and Future Directions
Several limitations should be considered when interpreting these results. It is important to note that our current framework is designed for personalized BCI systems, aiming to optimize temporal performance via cross-session validation. Consequently, this study focuses on the critical task of maintaining performance once a user has been calibrated. Given this scope, the first constraint is the modest sample size of six subjects. While adequate for this proof-of-concept pilot study, it limits the generalizability of the findings and necessitates expansion to larger, more diverse populations for population-level conclusions. Second, the short temporal intervals of 1–2 days between recording sessions reflect typical laboratory conditions but may not capture the challenges associated with long-term or real-world BCI deployment spanning weeks or months. Finally, while beyond the current scope, the substantial challenge of cross-subject generalization (spatial variability across subjects) remains an important area for future BCI development.
Future work will focus on three key areas to bridge the gap between laboratory results and clinical deployment:
- Expanded Validation, Benchmarking, and Generalizability: We will run extended longitudinal studies over days or weeks to figure out the best recalibration schedules for long-term use. We will also test our framework on larger, more diverse populations. Furthermore, external validation is essential. While our custom data was controlled, we must benchmark it against established public datasets (e.g., BCI Competition IV Dataset 2a [43], BNCI Horizon 2020 [44]). Since these public sets often lack enough multi-session data, our future work must specifically (1) evaluate our framework on existing publicly available multi-session datasets and (2) conduct a formal comparative analysis against published cross-session methods.
- Advanced Methodological Integration: We plan to enhance the core processing by integrating advanced methods like Riemannian geometry for feature extraction and incorporating adaptive learning systems. We will also perform an ablation study to formally compare our current dual-binary-classification approach against a single four-class classifier. This will definitively show the practical benefits of our modular design.
- Real-World Translation: The modularity of our dual-binary architecture is highly beneficial for real-time applications. It is perfectly suited for integration with robotic or assistive device control systems. In these cases, one classifier output (e.g., hand) can handle left/right commands, while the other (e.g., foot) handles forward/backward movement, creating intuitive control schemes. Future research will explore the practical deployment of this architecture for closed-loop, BCI-driven robotic control and adaptive user interface designs [41], leveraging its modularity and independent optimization to enhance real-world usability. We will also explore the use of wireless EEG telemonitoring [45] to support remote BCI applications.
4. Conclusions
This dual-validation framework establishes a comprehensive evaluation method for MI-BCIs. Crucially, it demonstrated minimal laboratory-to-practice performance degradation, showing only a 2.5% average drop in accuracy. This minimal degradation is a highly encouraging result for the future of reliable BCI deployment. Our key contributions include (1) a systematic dual-validation methodology addressing temporal robustness, (2) comprehensive cross-session validation demonstrating motor imagery classification stability, (3) systematic performance stability quantification providing realistic deployment readiness assessment, and (4) task-specific insights informing flexible BCI application design.
The strong cross-session robustness (with KNN achieving 81.2% accuracy and a 0.663 robustness score) is vital for personalized BCI systems that rely on consistent long-term performance after initial training. This system is well-suited for integration into clinical applications like neurorehabilitation, assistive communication devices, powered wheelchair control, and robotic prosthesis control. For example, the modular dual-binary architecture allows simple control schemes, where hand imagery might handle left/right commands and foot imagery handles forward/backward movement, enabling intuitive real-world operation. This research significantly extends previous work [4,5] by addressing critical validation limitations and providing a clear evidence-based pathway for translating MI-BCI technology to practical use.
Supplementary Materials
The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/technologies13120595/s1, The Supplementary Materials contain a detailed flowchart of the experimental and data processing workflow, specifications for the OpenBCI data acquisition and stream organization, and a comparative discussion of the dual-binary versus single multi-class architectures.
Author Contributions
Methodology, M.A.H. and S.Y.; Software, M.A.H. and S.Y.; Validation, M.A.H.; Formal analysis, M.A.H. and S.Y.; Data curation, M.A.H., S.Y., and D.Y.; Writing – original draft, M.A.H.; Writing – review & editing, P.S., M.M.R., M.A.H., and D.O.P.; Visualization, M.A.H. and P.S.; Supervision, D.O.P.; Project administration, D.O.P.; Funding acquisition, D.O.P. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by NSF EPSCOR Award 1849213.
Institutional Review Board Statement
The study was conducted and approved by the Institutional Review Board of University of Louisville (protocol code [19.0329] and date of approval [29 March 2025]).
Informed Consent Statement
Informed consent was obtained from all subjects involved in the study.
Data Availability Statement
Data can be found at https://github.com/MAHanafy/EEG_dataset_H_F (accessed on 17 November 2025). The complete analysis pipeline is available at https://github.com/MAHanafy/Motor_Imagery_WS_CS_P (accessed on 17 November 2025).
Conflicts of Interest
The authors declare no conflict of interest.
References
- Tarara, P.; Przybył, I.; Schöning, J.; Gunia, A. Motor imagery-based brain-computer interfaces: An Exploration of multiclass motor imagery-based control for Emotiv EPOC X. Front. Neuroinform. 2025, 19, 1625279. [Google Scholar] [CrossRef] [Scilit]
- Saibene, A.; Caglioni, M.; Corchs, S.; Gasparini, F. EEG-based BCIs on motor imagery paradigm using wearable technologies: A systematic review. Sensors 2023, 23, 2798. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Lotte, F.; Bougrain, L.; Cichocki, A.; Clerc, M.; Congedo, M.; Rakotomamonjy, A.; Yger, F. A review of classification algorithms for EEG-based brain-computer interfaces: A 10 year update. J. Neural Eng. 2018, 15, 031005. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Hanafy, M.A.; Yusufjonov, S.; Yusufjonov, D.; Sharafianardakani, P.; Rayguru, M.M.; Popa, D.O. A Robust EEG brain-Computer interface approach for decoding hand and foot motor imagery. In Proceedings of the the 18th ACM International Conference on PErvasive Technologies Related to Assistive Environments 2025, Corfu, Greece, 25–27 June 2025; pp. 92–100. [Google Scholar] [CrossRef] [Scilit]
- Hanafy, M.A.; Reynolds, H.L.; Jones, J.; Harris, D.; Popa, D.O. Assessment of BCI performance for human-robot interaction. In Proceedings of the 17th International Conference on PErvasive Technologies Related to Assistive Environments 2024, Crete, Greece, 26–28 June 2024; pp. 252–258. [Google Scholar] [CrossRef] [Scilit]
- Huang, G.; Zhao, Z.; Zhang, S.; Hu, Z.; Fan, J.; Fu, M.; Chen, J.; Xiao, Y.; Wang, J.; Dan, G. Discrepancy between inter-and intra-subject variability in EEG-based motor imagery brain-computer interface: Evidence from multiple perspectives. Front. Neurosci. 2023, 17, 1122661. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Vidaurre, C.; Ramos-Murguialday, A.; Haufe, S.; Gizzi, L.; Sannelli, C.; Braun, C.; Birbaumer, N. Enhancing sensorimotor BCI performance with assistive afferent activity: An online study. NeuroImage 2020, 199, 375–386. [Google Scholar] [CrossRef] [Scilit]
- Ma, J.; Yang, B.; Qiu, W.; Li, Y.; Gao, S.; Xia, X. A large EEG dataset for studying cross-session variability in motor imagery brain-computer interface. Sci. Data 2022, 9, 531. [Google Scholar] [CrossRef] [Scilit]
- Lotey, T.; Keserwani, P.; Wasnik, G.; Roy, P.P. Cross-session motor imagery EEG classification using self-supervised contrastive learning. In Proceedings of the 2022 26th International Conference on Pattern Recognition (ICPR), Montreal, QC, Canada, 21–25 August 2022; pp. 975–981. [Google Scholar] [CrossRef] [Scilit]
- Liu, W.; Guo, C.; Gao, C. A cross-session motor imagery classification method based on riemannian geometry and deep domain adaptation. Expert Syst. Appl. 2024, 237, 121612. [Google Scholar] [CrossRef] [Scilit]
- Abiri, R.; Borhani, S.; Sellers, E.W.; Jiang, Y.; Zhao, X. A comprehensive review of EEG-based brain–computer interface paradigms. J. Neural Eng. 2019, 16, 011001. [Google Scholar] [CrossRef] [Scilit]
- Hehenberger, L.; Kobler, R.J.; Lopes-Dias, C.; Srisrisawang, N.; Tumfart, P.; Uroko, J.B.; Torke, P.R.; Müller-Putz, G.R. Long-term mutual training for the CYBATHLON BCI race with a tetraplegic pilot: A case study on inter-session transfer and intra-session adaptation. Front. Hum. Neurosci. 2021, 15, 635777. [Google Scholar] [CrossRef] [Scilit]
- Raza, A.; Yusoff, M.Z. Deep learning approaches for eeg-motor imagery based bcis: Current models, generalization challenges, and emerging trends. IEEE Access 2025, 13, 151866–151893. [Google Scholar] [CrossRef] [Scilit]
- Craik, A.; He, Y.; Contreras-Vidal, J.L. Deep learning for electroencephalogram (EEG) classification tasks: A review. J. Neural Eng. 2019, 16, 031001. [Google Scholar] [CrossRef] [Scilit]
- Abibullaev, B.; Keutayeva, A.; Zollanvari, A. Deep learning in EEG-based BCIs: A comprehensive review of transformer models, advantages, challenges, and applications. IEEE Access 2023, 11, 127271–127301. [Google Scholar] [CrossRef] [Scilit]
- Chen, P.; Liu, X.; Ma, C.; Wang, H.; Yang, X.; Grebogi, C.; Gu, X.; Gao, Z. Unsupervised domain adaptation with synchronized self-training for cross-domain motor imagery recognition. IEEE J. Biomed. Health Inform. 2025, 29, 3664–3677. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Berdyshev, D.A.; Grachev, A.M.; Shishkin, S.L.; Kozyrskiy, B.L. EEG-Reptile: An automatized reptile-based meta-learning library for BCIs. arXiv 2024, arXiv:2412.19725. [Google Scholar] [CrossRef] [Scilit]
- Zhu, L.; Liu, Y.; Liu, R.; Peng, Y.; Cao, J.; Li, J.; Kong, W. Decoding multi-brain motor imagery from EEG using coupling feature extraction and few-shot learning. IEEE Trans. Neural Syst. Rehabil. Eng. 2023, 31, 4683–4692. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Deny, P.; Cheon, S.; Son, H.; Choi, K.W. Hierarchical transformer for motor imagery-based brain computer interface. IEEE J. Biomed. Health Inform. 2023, 27, 5459–5470. [Google Scholar] [CrossRef] [Scilit]
- Zhang, H.; Li, H. Transformer-based EEG decoding: A survey. arXiv 2025, arXiv:2507.02320. [Google Scholar] [CrossRef] [Scilit]
- Wang, X.; Hersche, M.; Magno, M.; Benini, L.; An, F. Transformer-based spatial-temporal feature learning for EEG decoding. arXiv 2021, arXiv:2106.11170. [Google Scholar] [CrossRef] [Scilit]
- Lionakis, E.; Karampidis, K.; Papadourakis, G. Current trends, challenges, and future research directions of hybrid and deep learning techniques for motor imagery brain–computer interface. Multimodal Technol. Interact. 2023, 7, 95. [Google Scholar] [CrossRef] [Scilit]
- Yue, J.; Xiao, X.; Wang, K.; Yi, W.; Jung, T.P.; Xu, M.; Ming, D. Augmenting electroencephalogram transformer for steady-state visually evoked potential-based brain–computer interfaces. Cyborg Bionic Syst. 2025, 6, 0379. [Google Scholar] [CrossRef] [Scilit]
- Cui, J.; Yuan, L.; Wang, Z.; Li, R.; Jiang, T. Towards best practice of interpreting deep learning models for EEG-based brain computer interfaces. Front. Comput. Neurosci. 2023, 17, 1232925. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Aleixo, E.L.; Colonna, J.G.; Cristo, M.; Fernandes, E. Catastrophic forgetting in deep learning: A comprehensive taxonomy. arXiv 2023, arXiv:2312.10549. [Google Scholar] [CrossRef] [Scilit]
- Gwon, D.; Won, K.; Song, M.; Nam, C.S.; Jun, S.C.; Ahn, M. Review of public motor imagery and execution datasets in brain-computer interfaces. Front. Hum. Neurosci. 2023, 17, 1134869. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Hu, H.; Yue, K.; Guo, M.; Lu, K.; Liu, Y. Subject separation network for reducing calibration time of MI-based BCI. Brain Sci. 2023, 13, 221. [Google Scholar] [CrossRef] [Scilit]
- Lin, C.L.; Chen, L.T. Improvement of brain–computer interface in motor imagery training through the designing of a dynamic experiment and FBCSP. Heliyon 2023, 9, e13745. [Google Scholar] [CrossRef] [Scilit]
- Wu, D.; Jiang, X.; Peng, R. Transfer learning for motor imagery based brain–computer interfaces: A tutorial. Neural Netw. 2022, 153, 235–253. [Google Scholar] [CrossRef] [Scilit]
- Ma, S.; Situ, Z.; Peng, X.; Li, Z.; Huang, Y. Multi-class classification methods for EEG signals of lower-limb rehabilitation movements. Biomimetics 2025, 10, 452. [Google Scholar] [CrossRef] [Scilit]
- Wei, Q.; Ding, X. Intra- and inter-subject common spatial pattern for reducing calibration effort in MI-based BCI. IEEE Trans. Neural Syst. Rehabil. Eng. 2023, 31, 904–916. [Google Scholar] [CrossRef] [Scilit]
- Lazcano-Herrera, A.G.; Fuentes-Aguilar, R.Q.; Chairez, I.; Alonso-Valerdi, L.M.; Gonzalez-Mendoza, M.; Alfaro-Ponce, M. Review on BCI virtual rehabilitation and remote technology based on EEG for assistive devices. Appl. Sci. 2022, 12, 12253. [Google Scholar] [CrossRef] [Scilit]
- Kwon, O.Y.; Lee, M.H.; Guan, C.; Lee, S.W. Subject-independent brain–computer interfaces based on deep convolutional neural networks. IEEE Trans. Neural Netw. Learn. Syst. 2019, 31, 3839–3852. [Google Scholar] [CrossRef] [Scilit]
- Hosseini, M.P.; Tran, T.X.; Pompili, D.; Elisevich, K.; Soltanian-Zadeh, H. Multimodal data analysis of epileptic EEG and rs-fMRI via deep learning and edge computing. Artif. Intell. Med. 2020, 104, 101813. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- OpenBCI. All-in-One EEG Electrode Cap Bundle. Available online: https://shop.openbci.com/products/all-in-oneeeg-electrode-cap-bundle?srsltid=AfmBOooyt8wz7zTErJj2Wnami7pzNLiAvYo2ySk-K-pRGhu6-jMHg8gI (accessed on 15 August 2025).
- Reynolds, H.L.; Hanafy, M.A.; Jones, J.; Harris, D.; Popa, D.O. Comparative study of one-handed vs two-handed EEG intent recognition for applications in human-robot interaction. In Proceedings of the 17th International Conference on PErvasive Technologies Related to Assistive Environments, Crete, Greece, 26–28 June 2024; pp. 496–503. [Google Scholar] [CrossRef] [Scilit]
- Blankertz, B.; Tomioka, R.; Lemm, S.; Kawanabe, M.; Muller, K.R. Optimizing spatial filters for robust EEG single-trial analysis. IEEE Signal Process. Mag. 2007, 25, 41–56. [Google Scholar] [CrossRef] [Scilit]
- Pfurtscheller, G.; Brunner, C.; Schlögl, A.; Da Silva, F.L. Mu rhythm (de) synchronization and EEG single-trial classification of different motor imagery tasks. NeuroImage 2006, 31, 153–159. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ang, K.K.; Chin, Z.Y.; Zhang, H.; Guan, C. Filter bank common spatial pattern (FBCSP) in brain-computer interface. In Proceedings of the 2008 IEEE International Joint Conference on Neural Networks (IEEE World Congress on Computational Intelligence), Hong Kong, China, 1–8 June 2008; pp. 2390–2397. [Google Scholar] [CrossRef] [Scilit]
- Jose, N.; Gore, D.; Vivekanandan, G.; Nithya, E.; Nallarasan, V.; Krishnakumar, K. Efficient predefined time adaptive neural network for motor execution EEG signal classification based brain-computer interaction. Knowl.-Based Syst. 2024, 303, 112270. [Google Scholar] [CrossRef] [Scilit]
- Sharafianardakani, P.; Hanafy, M.A.; Kondaurova, I.; Ashary, A.; Rayguru, M.M.; Popa, D.O. Adaptive user interface with parallel neural networks for robot teleoperation. IEEE Robot. Autom. Lett. 2024, 10, 963–970. [Google Scholar] [CrossRef] [Scilit]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar] [CrossRef]
- Tangermann, M.; Müller, K.R.; Aertsen, A.; Birbaumer, N.; Braun, C.; Brunner, C.; Leeb, R.; Mehring, C.; Miller, K.J.; Müller-Putz, G.R.; et al. Review of the BCI competition IV. Front. Neurosci. 2012, 6, 55. [Google Scholar] [CrossRef] [Scilit]
- Brunner, C.; Birbaumer, N.; Blankertz, B.; Guger, C.; Kübler, A.; Mattia, D.; Millán, J.d.R.; Miralles, F.; Nijholt, A.; Opisso, E.; et al. BNCI Horizon 2020: Towards a roadmap for the BCI community. Brain-Comput. Interfaces 2015, 2, 1–10. [Google Scholar] [CrossRef] [Scilit]
- Hanafy, M.A.; Ali, H.S.; Shaalan, A.A. Rakeness with block sparse Bayesian learning for efficient ZigBee-based EEG telemonitoring. Int. J. Commun. Syst. 2020, 33, e4219. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).






