An Attention-Based Bi-LSTM Architecture for Distinct Temporal Feature Extraction in EEG-Based Motor Imagery Classification
Subject Areas : New technologies in distributed systems and algorithmic computing
Hesam Hasanpour
1
*
,
Seyyed mahdi Ghezi
2
,
Yasser Elmi Sola
3
1 - Department of Computer Engineering and Information Technology, Sabzevar Branch, Islamic Azad University, Sabzevar, Iran
2 - Department of Computer Engineering and Information Technology, Sabzevar Branch, Islamic Azad University, Sabzevar, Iran
3 - Department of Computer Engineering and Information Technology, Sabzevar Branch, Islamic Azad University, Sabzevar, Iran
Keywords: Motor Imagery (MI), Brain-Computer Interface (BCI), EEG, Attention Mechanism, LSTM (Bi-LSTM), MI-BCI,
Abstract :
Motor Imagery (MI)-based Brain-Computer Interfaces (BCIs) rely heavily on the precise extraction of discriminative features from EEG signals, which are inherently non-stationary and complex in temporal dynamics. In this study, we propose an advanced deep learning model based on a Bidirectional Long Short-Term Memory (Bi-LSTM) architecture integrated with an attention mechanism to enhance the performance of MI classification tasks. The proposed model is designed to automatically extract and weigh temporal features across both forward and backward time directions, allowing the network to focus on the most informative EEG segments related to MI tasks.
We evaluated our model using the BCI Competition IV-2a dataset, comprising four MI classes across nine subjects. A stratified 5-fold cross-validation approach was employed, with each fold split into 40% training, 20% validation, and 40% testing sets. The proposed Attention-Bi-LSTM model achieved an average accuracy of 91.2% ± 3.5, F1-score of 91.1% ± 3.6, and Cohen's kappa of 0.883 ± 0.04, outperforming baseline CNN and LSTM models. Additionally, performance was analyzed separately across all four MI classes, highlighting the model’s ability to generalize across different cognitive motor tasks.
The results indicate that incorporating attention with Bi-LSTM substantially improves the model’s focus on discriminative EEG patterns, making it a promising architecture for robust and scalable EEG-based MI classification in real-world BCI applications
Nicolas-Alonso, L.F. and J. Gomez-Gil, Brain computer interfaces, a review. Sensors (Basel), 2012. 12(2): p. 1211-79.
Pfurtscheller, G. and C. Neuper, Motor imagery and direct brain-computer communication. Proceedings of the IEEE, 2001. 89(7): p. 1123-1134.
Lotte, F., et al., A review of classification algorithms for EEG-based brain–computer interfaces: a 10 year update. Journal of neural engineering, 2018. 15(3): p. 031005.
Lawhern, V.J., et al., EEGNet: a compact convolutional neural network for EEG-based brain-computer interfaces. J Neural Eng, 2018. 15(5): p. 056013.
Hochreiter, S. and J. Schmidhuber, Long Short-Term Memory. Neural Computation, 1997. 9: p. 1735-1780.
Cho, K., et al., Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
Huang, Z., et al., A model for EEG-based emotion recognition: CNN-BI-LSTM with attention mechanism. Electronics, 2023. 12(14): p. 3188.
Ma, Y., et al., A multi-channel feature fusion CNN-Bi-LSTM epilepsy EEG classification and prediction model based on attention mechanism. IEEE Access, 2023. 11: p. 62855-62864.
Khosravi, M., H. Parsaei, K. Rezaee, and M.S. Helfroush, Fusing convolutional learning and attention-based Bi-LSTM networks for early Alzheimer’s diagnosis from EEG signals towards IoMT. Scientific Reports, 2024. 14(1): p. 26002.
Mo, L., et al. A Bi-LSTM based network with attention mechanism for EEG visual classification. in 2021 IEEE International Conference on Unmanned Systems (ICUS). 2021. IEEE.
Chen, J., et al., EEG-based sleep staging via self-attention based capsule network with Bi-LSTM model. Biomedical Signal Processing and Control, 2023. 86: p. 105351.
Sharma, N. and S. Sharma, A lightweight methodology for Motor Imagery EEG classification utilizing step scaled wavelet fractals and Bi-LSTM architecture. 2025.
Yasaswini, P. and N. Devarakonda, Optimizing Non-Invasive Brain-Computer Interfaces: Bi LSTM Networks for Hand MotionRecognition from EEG Data. 2024. p. 1-6.
Bisla, M. and R.S. Anand, Optimized CNN‐Bi‐LSTM–Based BCI System for Imagined Speech Recognition Using FOA‐DWT. Advances in Human‐Computer Interaction, 2024. 2024(1): p. 8742261.