1 s2.0 S2666459324000064 mmc2
1 s2.0 S2666459324000064 mmc2
1 s2.0 S2666459324000064 mmc2
Abstract
∗ Correspondingauthor
Email address: mpk5904@psu.edu (Md Faisal Kabir)
1. Introduction
2
search, have significant drawbacks [12]. They can be computationally expensive
and inefficient in exploring the hyperparameter space, and they do not consider
the interactions between hyperparameters, which may impact the model’s per-
formance [16]. On the other hand, Bayesian Optimization (BO) is a compelling
solution, offering a conscientious and efficient approach for hyperparameter tun-
ing in DL models [16]. This probabilistic model-based optimization technique
iteratively updates the belief about the objective function to find the maximum
value in a minimum number of steps [15, 16].
In this study, we explore the efficacy of Bayesian Optimization in fine-tuning
hyperparameters for a deep-structured learning model dedicated to classifying
students’ confusion levels from EEG data. Confusion assessment is particularly
challenging due to the subtle nature of the cognitive states of the brain signal.
The proposed optimal DL model for the ODL-BCI maps hyperparameters to
a probability score on the objective function, creating a probabilistic and ac-
curate function model. Unlike traditional methods, it uses information from
past evaluations for future selection, thus offering an efficient exploration of
the hyperparameter space. By incorporating the complex interaction of hyper-
parameters and balancing exploration and exploitation in the hyperparameter
space, ODL-BCI improves the performance of the DL model, which surpasses
traditional ML and state-of-the-art approaches in accuracy and efficiency.
Our research contributes to the field by:
The ramifications of this work extend beyond the educational sphere, suggesting
potential adaptations in neurotherapeutic settings and human-computer inter-
3
action paradigms.
The rest of this paper is organized as Section 2 literature review, a summary
of similar existing works. Then, we move to Section 3 to explain the experimen-
tal setup and how we got EEG data. In Section 4, we detail our proposed DL
method. We share the results of our experiments in Section 5 and then wrap up
with Section 7, where we conclude and discuss future works, suggesting where
this research could go next.
2. Related Work
4
for enhancing the effectiveness of deep learning-based side-channel analysis.
Men and Li [7] investigate using EEG signals to detect student confusion in
Massive Open Online Courses (MOOCs). Their study demonstrates the poten-
tial of EEG-based analysis in monitoring and understanding the cognitive states
of students during online learning. By detecting confusion, this research con-
tributes to developing effective interventions and personalized learning strategies
in MOOCs, ultimately enhancing the learning experience. Kunang et al. [13]
the authors investigate the application of DL and hyperparameter optimization
techniques for classifying attacks in an intrusion detection system (IDS). The
study demonstrates the effectiveness of DL models in accurately classifying dif-
ferent types of attacks and the importance of hyperparameter optimization in
improving the performance of the IDS. This research contributes to cyberse-
curity by showcasing the potential of DL and hyperparameter optimization for
robust attack classification in IDS.
Cooney et al. [12] evaluate the impact of hyperparameter optimization in
the machine and DL methods for decoding imagined speech using EEG signals.
Their research emphasizes the importance of optimizing hyperparameters for
accurately and reliably decoding imagined speech from EEG data. The study
provides valuable insights into optimizing ML models for understanding speech-
related brain activity. Reñosa et al. [17] focus on classifying confusion levels
using EEG data and artificial neural networks (ANNs). Their study demon-
strates the potential of EEG-based classification in assessing cognitive states,
such as confusion. By leveraging ANNs, the authors provide insights into us-
ing EEG data for real-time cognitive assessment, with potential applications in
various fields, including education and human-computer interaction.
Miah et al. [18] using brain-machine interfaces (BMIs) to forecast the ori-
entations of voluntary hand movements and develop a real-time EEG classifi-
cation system. Their study demonstrates the feasibility of using EEG signals
to accurately classify hand movement directions in real time, contributing to
the advancement of BMIs. The research showcases the potential of EEG-based
BMIs for applications in prosthetics, rehabilitation, and assistive technology.
5
Thomas et al. [19] examine how DL methods are used in BCIs. According
to their research, convolutional neural networks (CNNs) and recurrent neural
networks (RNNs), two DL algorithms, perform better at accurately classifying
brain signals than more conventional techniques. This demonstrates how DL
can improve the functionality and performance of BCIs, opening the door to
more efficient brain-computer communication.
While these existing papers have significantly contributed to the BCIs field,
our paper addresses notable gaps. Firstly, many current approaches need more
focus on hyperparameter optimization, relying on traditional methods that
might limit BCI model optimization. Our paper introduces more efficient Bayesian
optimization for hyperparameter tuning. Secondly, there is a need for more spe-
cialized models for classifying cognitive states, such as confusion levels, using
EEG signals. Our paper bridges this gap by introducing ODL-BCI, designed ex-
plicitly for personalized education and cognitive state monitoring. Thirdly, the
efficiency required for practical BCI deployment in real-world scenarios should
be considered. Our paper emphasizes both effectiveness and efficiency. Lastly,
while previous studies primarily report accuracy, our comprehensive analysis
of sensitivity, precision, and F-score demonstrates the practical advantages of
ODL-BCI over existing algorithms, highlighting its novelty in these critical as-
pects.
The NeuroSky MindSet EEG headset is used by Wang et al. [20] to record
the ”confused student EEG brainwave” dataset. This headset is an innovative
BCI device engineered for the measurement and recording of electrical brain
activity through electroencephalography (EEG) [21]. It is primarily marketed
as a BCI device, allowing users to interact with various applications and devices
using their brainwave activity [22]. The main feature of the NeuroSky MindSet
headset is equipped with an EEG sensor, which is its primary component for
6
measuring the brain’s electrical activity [23]. This single dry electrode is strate-
gically positioned on the FP1 area of the forehead to capture brainwave data.
Complementing this, the headset also employs reference and ground sensors lo-
cated on the ear clip [21]. These are essential for establishing a baseline for the
EEG measurements, ensuring the captured data remains accurate and devoid of
external interference [24]. It records numeric values determined by proprietary
algorithms, reflecting the user’s mental states like attention and meditation.
The device also logs numeric values for frequency bands, capturing data from 0
to 60Hz every half-second [17].
Figure 1: NeuroSky headset electrodes distribution according to the 10-20 international sys-
tem. Source: NeuroSky.
7
3.2. EEG Dataset Background and Description
The primary objective of the EEG dataset was to investigate the relation-
ship between students’ confusion levels and EEG signals while watching Massive
Open Online Courses (MOOC). The dataset was inspired by a pilot study con-
ducted by Wang et al. [20], where college students’ EEG signals were collected
to determine their confusion levels when exposed to MOOC content.
Ten college students were enlisted in this dataset to participate in the study.
Each student is equipped with a wireless single-channel Neurosky MindSet EEG
headset. [27], which precisely measured cerebral activity over the frontal lobe.
These students were tasked with watching a set of ten 2-minute-long videos.
The MindSet EEG device adeptly extracted a comprehensive set of features, as
outlined in Table 1, to capture various aspects of cognitive responses. Notable
features included ”Attention,” serving as a metric for the students’ mental focus,
and ”Meditation,” quantifying levels of calmness.
Furthermore, the original EEG signals were averaged and represented by the
”Raw” feature. Features from various power spectrum frequency regions were
also included in the dataset. These features were sampled at a frequency of 2 Hz,
providing a detailed insight into students’ cognitive states. The total number of
data samples for this selected dataset is 12,811, where confused are 6,567 and
not-confused are 6,244. Based on the duration of the material presented to each
8
Figure 2: Correlation matrix plot of the extracted features from EEG neuroheadset.
student, these data samples are split into average values of 120. With ten data
points from each student, this yields 100 data points. The researchers cut out
the first and last 30 seconds from each visual material to represent roughly 60
seconds of data samples in each data point. Only the middle portion of each
recording was shown to the participating students in the experiment where the
dataset was gathered. So, each visual material had an approximate duration of
two minutes or less.
Figure 2 shows the extracted features’ correlation matrix with a color bar
that emphasizes the likelihood that each extracted feature will be correlated with
the other. There is a chance that the diagonal will have one (off-white). As can
be seen, the hierarchical clustering approach was used to display the correlation
matrix. Light colors indicate positive correlations, while deep shades indicate
negative correlations. The box shows the values of the correlation coefficient, ei-
ther positive or negative. The colors are mapped with varying coefficient values
on the right side. As can be seen, the correlation between attention and medita-
9
tion and the remaining features is inverse, and the highest linear correlation was
found between the extracted features’ beta and gamma signals. The ODL-BCI
datasets are available for anyone athttps://github.com/MdOchiuddinMiah/ODL-
BCI/tree/main/Datasets.
4. Classification Techniques
10
4.1.2. AdaBoost
AdaBoost is an ensemble learning method that combines several weak clas-
sifiers’ predictions to produce a robust classifier[1]. It focuses on rectifying the
errors of prior classifiers, ultimately enhancing classification accuracy [28]. We
used the C4.5 algorithm and 100 learners to train and build a robust classifier.
4.1.3. Bagging
Bagging, or Bootstrap Aggregating, is another ensemble method that crafts
numerous base models using random subsets of the dataset [5]. The amalgama-
tion of these models results in better predictions, reducing overfitting [1]. We
used DecisionT reeClassif ier as the base estimator.
11
4.1.7. Support Vector Machines (SVM)
SVMs are potent classifiers that aim to identify a hyperplane best suited to
segregate data points from different classes [18]. They shine in high-dimensional
spaces and complex datasets [28]. We implement SVM with linearkernel and
predict proba to enable probability estimation.
4.1.8. XG Boost
Renowned for its speed and performance, XG Boost is a gradient-boosting
algorithm that builds an ensemble of decision trees iteratively, focusing on re-
ducing predictive errors [30]. We used binary : logistic for binary classification
with logistic regression [30] and 100 decision trees in the ensemble with one
random seed for reproducibility.
12
process. Binary crossentropy as loss function and optimizer Adam used to train
the model. Two nodes on the output layer represent the class label Confused
and Not-Confused, which used the activation function Sigmoid to calculate the
output of the nodes.
13
Table 4: The best performed hyperparameters for the deep structured model on students
confusion EEG dataset.
Figure 3: The work-flow of the proposed optimal deep learning model for student’s confusion
EEG dataset.
80% training and the remaining 20% test datasets. Following this, the Bayesian
optimization process generates a set of hyperparameters. The model is initial-
ized using these parameters, trained using the training data, and evaluated on
the test data. This cycle is repeated for each set of hyperparameters, with the
most accurate model on the test data identified as the best model. Its hyper-
parameters are then stored.
The developed DL model, with its bespoke structure and optimization pro-
14
cess, offers a potent approach to BCI data analysis. As confirmed by the results
shown in Table 5, the model surpasses traditional ML classifiers, demonstrating
an accuracy of 74%. This underscores the viability and superiority of DL mod-
els optimized with Bayesian optimization in BCI applications. The ODL-BCI
implementation with compared models source codes can be accessed by anyone
athttps://github.com/MdOchiuddinMiah/ODL-BCI/tree/main/Algorithms.
5. Experiments
15
Algorithm 1 Proposed deep learning model with optimized hyperparameters
by Bayesian Optimization
Input: BCI data D
Output: Optimized deep learning model
Method:
16
Algorithm 2 Bayesian Optimization for proposed deep learning model ODL-
BCI
Output: Optimized hyperparams
Method:
1: hyperparams = None;
2: for each iteration do
3: Sample params from the search space;
4: Perform cross-validation with params;
5: Calculate evaluation metric;
6: hyperparams ∪ {params, evaluation metric};
7: end for
8: Sort hyperparams in descending by evaluation metric;
9: return top hyperparams;
P|X|
i=1 assess(xi )
Accuracy = , xi ∈ X (1)
|X|
TP
P recision = (2)
TP + FP
TP
Recall = (3)
TP + FN
2 × precision × recall
F − score = (4)
precision + recall
TP
TPR = (5)
TP + FN
FP
FPR = (6)
FP + TN
The notations TP, TN, FP, and FN denote the true positive, true negative,
false positive, and false negative results, respectively [1].
17
5.2. Results
Our empirical results are embodied in Tables 2 through 5, which jointly pro-
vide a comprehensive view of the optimal DL model’s hyperparameter tuning,
comparative performance, and preferred configuration.
We initially evaluated the performances of the ODL-BCI model with differ-
ent learning parameters. These parameters were tested using a comprehensive
hyperparameter list, including the number of layers, nodes per layer, activation
function types, and learning rate, as Table. 2 detailed.
Table 3 tabulates the best parameters suggested by the grid search and
Bayesian optimization algorithms. The total execution time taken by the Grid
Search is more than 23 hours, almost double that of the Bayesian Algorithm.
Also, the number of runs for the Bayesian Algorithm is half the number for Grid
Search. A primary concern is the accuracy, and our observations indicate that
Bayesian optimization outperforms grid search regarding model accuracy 74%
and time efficiency.
The optimal hyperparameters for the DL model on students’ confusion EEG
dataset were selected based on the best performance metrics and are illustrated
in Table 4. This table elucidates the most practical combination of hidden
layers, nodes per layer, activation functions, and learning rate for the proposed
model. A four-layer model is proposed, employing RELU and PRELU activation
functions and adopting learning rates of 0.001 and 0.01.
Table 5: Accuracy and Average Sensitivity/Recall, Precision and F-score on EEG confusion
dataset.
18
Figure 4: ROC and AUC analysis of ODL-BCI model compared to popular classifiers on
students confusion EEG dataset.
Next, the performance of the ODL-BCI model was compared with exist-
ing methods, such as Decision Tree, AdaBoost, Bagging, MLP, Naı̈ve Bayes,
Random Forest, SVM, and XG Boost. The comparative analysis of accuracy,
precision, recall, and F-score of these classifiers on students’ confusion level
EEG data is presented in Table 5. The proposed DL model significantly out-
performs the existing classifiers. The ODL-BCI model achieves 74% accuracy,
precision, recall, and F-score, demonstrating superior performance to the other
tested classifiers. While existing ensemble approaches can reach up to 69.0%
accuracy, single classifiers in this dataset failed to achieve more than 60% accu-
racy. The table indicates that ODL-BCI outperforms other ensemble classifiers
used for this task by more than 5.0%. Fig. 4 displays the decision boundaries
of the suggested method compared to the classifiers used for this dataset.
For a more in-depth understanding of our DL model’s behaviour, we moni-
tored its training progress over 2000 epochs. Figures 5 and 6 depict the accuracy
and loss over time. Notably, we observed that after approximately 400 epochs,
accuracy and loss reached stable levels. The accuracy plateaued at around 0.67,
while the loss remained below 0.60. These observations suggest that our model
effectively captured the underlying patterns in the data, achieving remarkable
19
Figure 5: Accuracy over time after 2000 epochs for proposed ODL-BCI model using student’s
brain data..
performance.
Table 6: Compare with state-of-the-art methods used students confusion EEG dataset.
20
Figure 6: Loss over time for optimized deep learning model after 2000 epochs.
21
sion level classification.
6. Threats to Validity
22
student EEG brainwave data” dataset. This model achieved an impressive ac-
curacy of 74 percent, underscoring its potential as a valuable tool in the educa-
tional sector for real-time confusion level assessment.
Although the proposed model shows promising results, future work can fur-
ther enhance its capabilities. For instance, the model can be tested with a larger
dataset to verify its scalability. Incorporating other types of neural networks
and more advanced optimization algorithms can also be explored to improve the
model’s performance. Furthermore, real-world deployment of the model in the
educational sector can be examined to assess its practical utility in enhancing
student confusion and learning outcomes.
Conflict of Interest
References
23
from eeg signals: An intelligent neuromarketing framework, Frontiers in
Human Neuroscience 16 (2022).
[7] X. Men, X. Li, Detecting the confusion of students in massive open online
courses using eeg, International Journal of Education and Humanities 4 (2)
(2022) 72–77.
24
[12] C. Cooney, A. Korik, R. Folli, D. Coyle, Evaluation of hyperparameter
optimization in machine and deep learning methods for decoding imagined
speech eeg, Sensors 20 (16) (2020) 4629.
25
[19] J. Thomas, T. Maszczyk, N. Sinha, T. Kluge, J. Dauwels, Deep learning-
based classification for brain-computer interfaces, in: 2017 IEEE Interna-
tional Conference on Systems, Man, and Cybernetics (SMC), IEEE, 2017,
pp. 234–239.
[22] O.-A. Rus, anu, Python implementation for brain-computer interface re-
search by acquiring and processing the neurosky eeg data for classifying
multiple voluntary eye-blinks, in: 5th International Conference on Nan-
otechnologies and Biomedical Engineering: Proceedings of ICNBME-2021,
November 3-5, 2021, Chisinau, Moldova, Springer, 2022, pp. 666–672.
[25] K. Wang, Z. Wang, Y. Guo, F. He, H. Qi, M. Xu, D. Ming, An eeg study
on hand force imagery for brain-computer interfaces, in: 2017 8th Interna-
tional IEEE/EMBS Conference on Neural Engineering (NER), IEEE, 2017,
pp. 668–671.
26
[26] F. R. Mashrur, K. Mahmudur, M. T. I. Miya, R. Vaidyanathan, S. F.
Anwar, F. Sarker, K. A. Mamun, An intelligent neuromarketing system for
predicting consumers’ future choice from electroencephalography signals,
Physiology & Behavior (2022) 113847.
[30] F. Wang, Y.-C. Tian, X. Zhang, F. Hu, An ensemble of xgboost models for
detecting disorders of consciousness in brain injuries through eeg connec-
tivity, Expert Systems with Applications 198 (2022) 116778.
27