Nashwa Mosaad Othman, Khalid Ahmed. Elshafey, Mohamad Khalil. Refai, Basim Mohamed. Ayoub
Subject-independent motor imagery (MI) decoding remains challenging in EEG-based BCIs due to strong inter-subject variability and hidden data leakage risks.We propose a lightweight feature-engineered pipeline for binary MI open-close hand classification using a low-cost EEG system and evaluate it under a strict leave-one-subject-out (LOSO) protocol.To preserve strict subject independence, all preprocessing operations (robust scaling, power transformation, and variance filtering) were fitted exclusively on the training data within each LOSO fold and subsequently applied to the held-out subject.In addition, cross-subject duplicate inspection was performed, and feature vectors duplicated across different subjects were removed prior to LOSO evaluation.After duplicate removal and preprocessing validation, the dataset comprised 5,595 EEG windows collected from 52 subjects with balanced class distribution (Open = 2,804; Close = 2,791).Although 28 features were initially generated after augmentation (16 base + 12 derived), ablation analysis showed that the base feature set (16 features) achieved the best overall performance and was therefore retained for the final model.The proposed Random Forest-based classifier achieved 96.48% accuracy (balanced accuracy 96.48%, weighted F1-score 96.48%, ROC-AUC 0.9934, Cohen's kappa 0.9321, MCC 0.9323, and Brier score 0.0251) with a 95% confidence interval of [95.63%, 97.21%].Importantly, the evaluation pipeline incorporated strict leakage control through fold-wise preprocessing and cross-subject duplicate removal to ensure unbiased subject-independent validation.The aggregated confusion matrix revealed minimal cross-class misclassification, with 162 open trials predicted as close and 40 close trials predicted as open.Permutation testing yielded chance-level performance (0.4982 ± 0.0052), confirming that the reported accuracy is unlikely to arise from data leakage or statistical bias.These findings suggest that physiologically informed feature engineering combined with ensemble tree-based learning can provide a promising and computationally efficient framework for subjectindependent neurorehabilitation-oriented BCI systems.