Enhancing EEG-Based Emotion Recognition in Computer Games
Using KNN Optimized by the iHOW Optimization Algorithm
Abdelhameed Ibrahim1, Christos Gatzoulis1, El-Sayed M. El-kenawy1,2,∗ , Marwa M. Eid3,4
1School of ICT, Information Technology & Design Faculty, Bahrain Polytechnic, Isa Town, Bahrain
2Applied Science Research Center. Applied Science Private University, Amman, Jordan
3Faculty of Artificial Intelligence, Delta University for Science and Technology, Mansoura, Egypt
4Jadara University Research Center, Jadara University, Jordan
Emails: afai79@mans.edu.eg; christos.gatzoulis@polytechnic.bh; elsayed.elkenawy@polytechnic.bh;
marwa.3eeed@gmail.com
Abstract
Emotion recognition using electroencephalogram (EEG) signals has become a pivotal area in affective com-
puting, particularly within the context of human–computer interaction and game-based environments. This
study aims to enhance the accuracy and robustness of EEG-based emotion classification by introducing a
hybrid framework that combines the k-Nearest Neighbors (KNN) classifier with advanced metaheuristic fea-
ture selection techniques. Using the publicly available GAMEEMO dataset, which includes EEG recordings
from 28 subjects engaged in four emotionally distinct computer games (boring, calm, horror, and funny),
EEG data were acquired through a 14-channel Emotiv Epoc+ device and labeled using the Self-Assessment
Manikin (SAM) scale. Baseline machine learning models including Support Vector Machine (SVM), Decision
Tree (DT), Multi-Layer Perceptron (MLP), and KNN were evaluated, with KNN achieving the highest base-
line performance. The KNN classifier was further optimized using several metaheuristic algorithms—namely
WAO, BBO, GWO, GA, FA, PSO—and the proposed Improved Human Optimization Algorithm (iHOW).
Experimental results show that the iHOW+KNN model achieved the best overall performance with an accu-
racy of 96.85%, sensitivity of 95.50%, specificity of 95.82%, and F1-score of 95.54%. Visual assessments
using heatmaps, radar plots, and confidence intervals further validated the model’s reliability. These findings
demonstrate the effectiveness of the iHOW+KNN framework in addressing the challenges of high-dimensional
EEG data and highlight the potential of wearable EEG devices for real-time emotion recognition in affective
computing applications. into user experiences within the gaming environment.
Keywords: EEG signal processing; Affective computing; Metaheuristic optimization; iHOW algorithm; Com-
puter games