EEG motor imagery classification using machine learning techniques


  • R. T. Páez-Amaro Benemérita Universidad Autónoma de Puebla
  • E. Moreno-Barbosa Benemérita Universidad Autónoma de Puebla
  • J. M. Hernández-López Benemérita Universidad Autónoma de Puebla
  • C. H. Zepeda-Fernández Benemérita Universidad Autónoma de Puebla
  • L. F. Rebolledo-Herrera Benemérita Universidad Autónoma de Puebla
  • Benito de Celis Alonso Facultad de Ciencias Físico-Matemáticas. Benemérita Universidad Autónoma de Puebla. Puebla, Pue.



BMI, EEG, Machine Learning, motor imagery, pattern classification


A brain-machine interface (BMI), is a device or experimental setup that receives a brain signal, classifies it, and then uses it as a computer command. Even if large amounts of work exist in the field, there is not a consensus on which kind of learning methodology (deep learning, convolutional networks, AI, etc.) and/or type of algorithms in each methodology, are best to run BMIs. The aim of this work was to build a low-cost, portable, easy-to-use and a reliable BMI based on Motor Imagery Electro-encephalography. To this end, different algorithms were compared to find the one that best satisfied such conditions. In this study, motor imagery EEG signals, from both PhysioNet public data and from our own laboratory obtained using an Emotiv headset, were classified with four machine learning algorithms. These algorithms were: Common spatial patterns combined with linear discriminant analysis, Deep neural network, convolutional neural network and finally Riemannian minimum distance to mean. The mean accuracy for each method was 78%, 66%, 60% and 80% respectively. The best results were obtained for the baseline vs Motor Imagery comparison. With global-training public data, an accuracy between 86.4% and 99.9% was achieved. With global-training lab data, the accuracy was above 99% for Common Spatial Patterns and Riemannian cases. For lab data, the classification/prediction computing time per event were 8.3 ms, 18.1 ms, 62 ms and 9.9 ms, respectively. In the discussion a comparison between the results presented here and state-of-the-art of methodologies and algorithms for BMIs can be found. We concluded that Common spatial patterns and Riemannian minimum distance to mean, algorithms resulted in fast (computing time) and effective (success rate) tools for their implementation as deep learning algorithms in BMIs.


Organización Mundial de la Salud. (2011) Informe Mundial Sobre la Discapacidad. Resumen. Retrieved from

Consejo Nacional para el Desarrollo y la Inclusión de las Personas con Discapacidad. (2018). La Esclerosis Lateral Amiotrófica ELA. Retrieved from

Instituto Nacional de Estadística y Geografía. (2020) Población con limitación o discapacidad por entidad federativa y tipo de actividad que realiza o condición mental según sexo, 2020. Retrieved from

Biblioteca de Publicaciones Oficiales del Gobierno de la República. (2018). Diagnóstico sobre la situación de las personas con discapacidad en México. Retrieved from

Clerc, M., Bougrain, L. and Lotte, F. (2016) Brain-Computer Interfaces 1: Foundations and Methods. New York: Wiley

Graimann, B., Allison, B. Z., & Pfurtscheller, G. (2013). Brain-Computer Interfaces Revolutionizing Human-Computer Interaction. Berlin: Springer Berlin.

Mizuguchi, N., Nakata, H., Uchida, Y., & Kanosue, K. (2012). Motor imagery and sport performance. The Journal of Physical Fitness and Sports Medicine, 1(1), 103-111. doi:10.7600/jpfsm.1.103

Tyagi, A., & Nehra, V. (2013) Brain-computer interface: a thought translation device turning fantasy into reality. Biomedical Engineering and Technology, 11(2), 197-211. doi:10.1504/ijbet.2013.055044

Scherer, R., & Vidaurre, C. (2018). Motor imagery based brain–computer interfaces. Smart Wheelchairs and Brain-Computer Interfaces, 171-195. doi:10.1016/b978-0-12-812892-3.00008-x

Olías, J. (2016) Estudio del método Common Spatial Patterns y sus variantes en interfaces cerebro-ordenador. (Thesis, 2016). Escuela Técnica Superior de Ingeniería, Universidad de Sevilla.

Mahmood, A., Zainab, R., Ahmad, R. B., Saeed, M., & Kamboh, A. M. (2017). Classification of multi-class motor imagery EEG using four band common spatial pattern. 2017 39th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), 1034-1037. doi:10.1109/embc.2017.8037003

Blankertz, B., Tomioka, R., Lemm, S., Kawanabe, M., & Muller, K. (2008). Optimizing Spatial filters for Robust EEG Single-Trial Analysis. IEEE Signal Processing Magazine, 25(1), 41-56. doi:10.1109/msp.2008.4408441

Acuña, K. (2017). Procesamiento de señales electroencefalográficas en un sistema embebido para una interfaz cerebro máquina (Thesis, 2017). Pontificia Universidad Católica del Perú.

SciKit Learn (n.d.). 1.2. Linear and Quadratic Discriminant Analysis. Retrieved from

Aguiar, S., Yanez, W., & Benitez, D. (2016). Low complexity approach for controlling a robotic arm using the Emotiv EPOC headset. 2016 IEEE International Autumn Meeting on Power, Electronics and Computing (ROPEC). doi:10.1109/ropec.2016.7830526

Kolodziej, M., Majkowski, A., Zapala, D., Rak, R. J., & Francuz, P. (2018). Methods of Power-Band Extraction Techniques for BCI Classification. 19th International Conference Computational Problems of Electrical Engineering. doi:10.1109/cpee.2018.8506786

Bhattacharyya, S., Hossain, M. A., Konar, A., Tibarewala, D. N., & Ramadoss, J. (2014). Detection of Fast and Slow Hand Movements from Motor Imagery EEG Signals. Smart Innovation, Systems and Technologies Advanced Computing, Networking and Informatics, 1, 645-652. doi:10.1007/978-3-319-07353-8_74

Huang, S., & Wu, X. (2010). Feature extraction and classification of EEG for imagery movement based on mu/beta rhythms. 2010 3rd International Conference on Biomedical Engineering and Informatics, 891-894. doi:10.1109/bmei.2010.5639888

Ko, L., Lin, S., Song, M., & Komarov, O. (2014). Developing a few-channel hybrid BCI system by using motor imagery with SSVEP assist. 2014 International Joint Conference on Neural Networks (IJCNN), 4114-4120. doi:10.1109/ijcnn.2014.6889901

Yang, J., Yao, S., & Wang, J. (2018). Deep Fusion Feature Learning Network for MI-EEG Classification. IEEE Access, 6, 79050-79059. doi:10.1109/access.2018.2877452

Elstob, D., & Secco, E. L. (2016). A Low Cost Eeg Based Bci Prosthetic Using Motor Imagery. International Journal of Information Technology Convergence and Services, 6(1), 23-36. doi:10.5121/ijitcs.2016.6103

Duda, R. O., Stork, D. G., & Hart, P. E. (2000). Pattern classification (2nd ed.). John Wiley & Sons.

Schmidhuber, J. (2015). Deep learning in neural networks: An overview. Neural Networks, 61, 85-117. doi: 10.1016/j.neunet.2014.09.003

Benitez, D. S., Toscano, S., & Silva, A. (2016). On the use of the Emotiv EPOC neuroheadset as a low cost alternative for EEG signal acquisition. 2016 IEEE Colombian Conference on Communications and Computing (COLCOM). doi:10.1109/colcomcon.2016.7516380

Amarasinghe, K., Wijayasekara, D., & Manic, M. (2014). EEG based brain activity monitoring using Artificial Neural Networks. 2014 7th International Conference on Human System Interactions (HSI), 61-66. doi:10.1109/hsi.2014.6860449

Hamedi, M., Salleh, S.-H., Noor, A. M., & Mohammad-Rezazadeh, I. (2014). Neural network-based three-class motor imagery classification using time-domain features for BCI applications. 2014 IEEE REGION 10 SYMPOSIUM, 204-207. doi:10.1109/tenconspring.2014.6863026

Chatterjee, R., & Bandyopadhyay, T. (2016).EEG Based Motor Imagery Classification Using SVM and MLP. 2016 2nd International Conference on Computational Intelligence and Networks (CINE), 84-89. doi:10.1109/cine.2016.22

Tyagi, A., & Nehra, V. (2016). Classification of motor imagery EEG signals using SVM, k-NN and ANN. CSI Transactions on ICT, 4(2-4), 135-139. doi:10.1007/s40012-016-0091-2

Dhillon, A., & Verma, G. K. (2019). Convolutional neural network: A review of models, methodologies and applications to object detection. Progress in Artificial Intelligence, 9(2), 85-112. doi:10.1007/s13748-019-00203-0

Aloysius, N., & Geetha, M. (2017). A review on deep convolutional neural networks. 2017 International Conference on Communication and Signal Processing (ICCSP), 588-592. doi:10.1109/iccsp.2017.8286426

Jiao, J., Zhao, M., Lin, J., & Liang, K. (2020). A comprehensive review on convolutional neural network in machine fault diagnosis. Neurocomputing, 417, 36-63. doi:10.1016/j.neucom.2020.07.088

Tabar, Y. R., & Halici, U. (2016). A novel deep learning approach for classification of EEG motor imagery signals. Journal of Neural Engineering, 14(1), 1-11.doi:10.1088/1741-2560/14/1/016003

Tian, G., & Liu, Y. (2018). Study on Classification of Left-Right Hands Motor Imagery EEG Signals Based on CNN. 2018 IEEE 17th International Conference on Cognitive Informatics & Cognitive Computing (ICCI*CC), 324-329. doi: 10.1109/icci-cc.2018.8482042

Dose, H., Müller, J. S., Iversen, H. K., & Puthusserypady, S. (2018). An end-to-end deep learning approach to MI-EEG signal classification for BCIs. Expert Systems with Applications, 114, 532-542. doi: 10.1016/j.eswa.2018.08.031

Chaudhary, S., Taran, S., Bajaj, V., & Sengur, A. (2019). Convolutional Neural Network Based Approach Towards Motor Imagery Tasks EEG Signals Classification. IEEE Sensors Journal, 19(12), 1-7. doi: 10.1109/jsen.2019.2899645

Tayeb, Z., Fedjaev, J., Ghaboosi, N., Richter, C., Everding, L., Qu, X., & Conradt, J. (2019). Validating Deep Neural Networks for Online Decoding of Motor Imagery Movements from EEG Signals. Sensors, 19(210), 1-17. doi: 10.3390/s19010210

Lotte, F., Bougrain, L., Cichocki, A., Clerc, M., Congedo, M., Rakotomamonjy, A., & Yger, F. (2018). A review of classification algorithms for EEG-based brain–computer interfaces: A 10 year update. Journal of Neural Engineering, 15(3), 031005, 1-28. doi:10.1088/1741-2552/aab2f2

Marco Congedo, Alexandre Barachant & Rajendra Bhatia (2017): Riemannian geometry for EEG-based brain-computer interfaces; a primer and a review. Brain-Computer Interfaces, 4(3), 155-174. doi: 10.1080/2326263X.2017.1297192

Goldberger, A., Amaral, L., Glass, L., Hausdorff, J., Ivanov, P. C., Mark, R., ... & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation, 101 (23), e215–e220. doi:10.1161/01.cir.101.23.e215

Wolpaw, J., Mcfarland, D., Vaughan, T., & Schalk, G. (2003). The Wadsworth Center Brain-Computer Interface (BCI) Research and Development Program. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 11(2), 204-207. doi:10.1109/tnsre.2003.814442

Schalk, G., McFarland, D.J., Hinterberger, T., Birbaumer, N., Wolpaw, J.R. (2004) BCI2000: A General-Purpose Brain-Computer Interface (BCI) System. IEEE Transactions on Biomedical Engineering, 51(6), 1034-1043. doi:10.1109/tbme.2004.827072

Brunner, C., Leeb, R., Müller-Putz, G., Schlögl, A., Pfurtscheller, G. (2008) BCI Competition 2008 – Graz data set A. BCI Competition IV

Lee, H. K., & Choi, Y. (2018) A Convolution Neural Networks Scheme for Classification of Moto Imagery EEG based on Wavelet Time-Frequency Image. 2018 International Conference on Information Networking (ICOIN), 906-909. doi:10.1109/icoin.2018.8343254

Wu, Y., Huang, T. H., Lin, C. Y., Tsai, S. J., & Wang, P. (2018). Classification of EEG Motor Imagery Using Support Vector Machine and Convolutional Neural Network. 2018 International Automatic Control Conference (CACS). doi:10.1109/cacs.2018.8606765

Dozat, T. (2016) Incorporating Nesterov Momentum into Adam. ICLR Workshop, (1).

Stock, V. N., & Balbinot, A. (2016). Movement imagery classification in EMOTIV cap based system by Naïve Bayes. 2016 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), 4435-4438. doi:10.1109/embc.2016.7591711

Fakhruzzaman, M. N., Riksakomara, E., & Suryotrisongko, H. (2015). EEG Wave Identification in Human Brain with Emotiv EPOC for Motor Imagery. Procedia Computer Science, 72, 269-276. doi:10.1016/j.procs.2015.12.140

Fatmawati, E., Wijaya, S. K., & Prawito. (2017). Development Prototype System of Arms Motor Imagery Utilizing Electroencephalography Signals (EEG) from Emotiv with Probabilistic Neural Network (PNN) as Signal Analysis. 2017 5th International Conference on Instrumentation, Communications, Information Technology, and Biomedical Engineering (ICICI-BME), 179-183. doi:10.1109/icici-bme.2017.8537727

Wang, K., Wang, Z., Guo, Y., He, F., Qi, H., Xu, M., & Ming, D. (2017). An EEG study on hand force imagery for brain-computer interfaces. 2017 8th International IEEE/EMBS Conference on Neural Engineering (NER). doi:10.1109/ner.2017.8008439

Xiao, D., Mu, Z., & Hu, J. (2009). Classification of Motor Imagery EEG Signals Based on Energy Entropy. 2009 International Symposium on Intelligent Ubiquitous Computing and Education. doi:10.1109/iuce.2009.57

An, X., Kuang, D., Guo, X., Zhao, Y., & He, L. (2014). A Deep Learning Method for Classification of EEG Data Based on Motor Imagery. Lecture Notes in Computer Science, 203-210. doi:10.1007/978-3-319-09330-7_25

Mohammadpour, M., Ghorbanian, M., & Mozaffari, S. (2016). Comparison of EEG signal features and ensemble learning methods for motor imagery classification. 2016 Eighth International Conference on Information and Knowledge Technology (IKT), 288-292. doi:10.1109/ikt.2016.7777767

Bentlemsan, M., Zemouri, E., Bouchaffra, D., Yahya-Zoubir, B., & Ferroudji, K. (2014). Random Forest and Filter Bank Common Spatial Patterns for EEG-Based Motor Imagery Classification. 2014 5th International Conference on Intelligent Systems, Modelling and Simulation. doi:10.1109/isms.2014.46

Bhaduri, S., Khasnobish, A., Bose, R., & Tibarewala, D. N. (2016). Classification of lower limb motor imagery using K Nearest Neighbor and Naïve-Bayesian classifier. 2016 3rd International Conference on Recent Advances in Information Technology (RAIT). doi:10.1109/rait.2016.7507952

Shukla, P. K., & Chaurasiya, R. K. (2018). An Experimental Analysis of Motor Imagery EEG Signals Using Feature Extraction and Classification Methodologies. 2018 International Conference on Computing, Power and Communication Technologies (GUCON). doi:10.1109/gucon.2018.8675032




How to Cite

R. T. Páez-Amaro, E. Moreno-Barbosa, J. M. Hernández-López, C. H. Zepeda-Fernández, L. F. Rebolledo-Herrera, and B. de Celis Alonso, “EEG motor imagery classification using machine learning techniques”, Rev. Mex. Fís., vol. 68, no. 4 Jul-Aug, pp. 041102 1–, Jun. 2022.