Model Agnostic Meta Learning Ensemble Based Prediction of Motor Imagery Tasks Using EEG Signals
Fazal Ur Rehman1, Yazeed Alkhrijah2, Syed Muhammad Usman3, Muhammad Irfan1,*
1 Department of Electrical and Biomedical Engineering, Khwaja Fareed University of Engineering and Information Technology, Rahim Yar Khan, Pakistan
2 Department of Electrical Engineering, Imam Mohammad Ibn Saud Islamic University (IMSIU), Riyadh, Saudi Arabia
3 Department of Computer Science, Bahria School Engineering and Applied Sciences (BSEAS), Bahria University Islamabad, Islamabad, Pakistan
* Corresponding Author: Muhammad Irfan. Email:
(This article belongs to the Special Issue: Machine Learning and Deep Learning-Based Pattern Recognition)
Computer Modeling in Engineering & Sciences https://doi.org/10.32604/cmes.2026.076332
Received 18 November 2025; Accepted 14 January 2026; Published online 04 February 2026
Abstract
Automated detection of Motor Imagery (MI) tasks is extremely useful for prosthetic arms and legs of stroke patients for their rehabilitation. Prediction of MI tasks can be performed with the help of Electroencephalogram (EEG) signals recorded by placing electrodes on the scalp of subjects; however, accurate prediction of MI tasks remains a challenge due to noise that is incurred during the EEG signal recording process, the extraction of a feature vector with high interclass variance, and accurate classification. The proposed method consists of preprocessing, feature extraction, and classification. First, EEG signals are denoised using a bandpass filter followed by Independent Component Analysis (ICA). Multiple channels are combined to form a single surrogate channel. Short Time Fourier Transform (STFT) is then applied to convert time domain EEG signals into the frequency domain. Handcrafted and automated features are extracted from EEG signals and then concatenated to form a single feature vector. We propose a customized two-dimensional Convolutional Neural Network (CNN) for automated feature extraction with high interclass variance. Feature selection is performed using Particle Swarm Optimization (PSO) to obtain optimal features. The final feature vector is passed to three different classifiers: Support Vector Machine (SVM), Random Forest (RF), and Long Short-Term Memory (LSTM). The final decision is made using the Model-Agnostic Meta Learning (MAML). The Proposed method has been tested on two datasets, including PhysioNet and BCI Competition IV-2a, and it achieved better results in terms of accuracy and F1 score than existing state-of-the-art methods. The proposed framework achieved an accuracy and F1 score of 96% on the PhysioNet dataset and 95.5% on the BCI Competition IV, dataset 2a. We also present SHapley Additive exPlanations (SHAP) and Gradient-weighted Class Activation Mapping (Grad-CAM) explainable techniques to enhance model interpretability in a clinical setting.
Keywords
Motor imagery (MI); electroencephalogram (EEG); 2D-CNN; feature selection; explainable artificial intelligence (XAI); particle swarm optimization (PSO)