© 2025 The authors. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).
OPEN ACCESS
Classification of EEG signals is essential for diagnosing neurological disorders such as epilepsy and detecting brain abnormalities like tumors. In this study, we propose an attention-enhanced 1D Convolutional Neural Network (1D CNN) model to classify EEG signals into five categories: seizure activity, signals from tumorous regions, signals from adjacent healthy brain tissue, and eyes open/closed states. The dataset comprises EEG recordings from 500 individuals, segmented into 178-point intervals (1 second each), yielding a total of 11,500 samples. The proposed model outperforms the baseline non-attention 1D CNN by up to 1.30% in seizure detection accuracy, with consistent improvements across all five classification tasks. For epileptic seizure detection, it achieved 99.78% accuracy. In tumor-related classification, accuracies reached 92.74% for tumor regions and 92.91% for adjacent healthy tissue, while eyes open and closed states were classified with 99.35% and 99.22% accuracy, respectively. Although the model demonstrates strong performance overall, distinguishing between tumor regions and adjacent healthy tissue remains challenging. These findings underscore the potential of attention-based CNNs in automated EEG analysis, offering promising applications in clinical diagnostics and neuro-monitoring systems.
electroencephalogram (EEG), 1D CNN, preprocessing, classification, attention mechanism, epileptic seizure, temporal attention, clinical diagnostics
Throughout Modern technical developments have become essential in medical diagnostics today. These progresses dramatically transform how diseases are detected and managed. For example, advanced tools like algorithms and data analysis improve the accuracy of diagnostic processes and speed up the required time to deal with. All these revolutionary advancements lead to improved patient outcomes. Technologies like medical imaging and AI-powered systems are now efficiently integral to identifying complex medical conditions. Consequently, this integration of technology in modern medical diagnostics is driving new ideas to innovation and elevate healthcare standards [1, 2].
Figure 1. EEG signals distinct frequency bands
Electroencephalogram (EEG) signals play a crucial role in monitoring brain activity and diagnosing a wide range of neurological disorders, including but not limited to epilepsy, brain tumors, and other cerebral abnormalities [3]. The high dimensionality and complex nature of the EEG data not only present a significant challenge for the development of efficient algorithms aimed at automatic signal classification, but also highlight the need for advanced computational techniques both in medical research and in clinical practice. As shown in Figure 1, the EEG signals are composed of distinct frequency bands that carry critical information for classification. Moreover, precise classification plays an important role in detecting critical conditions like epileptic seizure and distinguishing between tumor-influenced brain areas [4].
Traditionally, visual examination of EEG recording data is highly labor-intensive and prone to errors, largely because of the large amounts of data and the subtlety of the differences observed between different brain states [5]. Recently, techniques involving machine learning (ML) and deep learning (DL) have emerged as some of the most powerful tools for automation in the analysis of EEG signals [6]. Among the many methods and methodologies available today, Convolutional Neural Networks (CNN’s) are becoming very promising because they can work very well for both feature extraction and classification [7]. CNN designs may be adaptable enough to support different practical use cases with only minor modifications [8].
For instance, popular CNN models like AlexNet, GoogleNet, and VGG, are focused primarily on classification tasks, typically by concatenating fully-connected layers with the various classifiers. In this process, the early layers focus mainly on capturing simple patterns, while the latter layers are tuned to recognize more detailed features. This will help the model to identify complete objects or scenes [9].
Among many CNN models, 1D CNNs are a simplified variant of 2D CNNs, optimized for one-dimensional input like time series. 1D CNNs work well on signals like EEG, where information unfolds over time [10, 11].
1D convolutional operations are effective for identifying localized features within input sequences, making them very suitable for processing various types of sequential data such as text, audio, and time series. In particular, to extract features at multiple points, the convolution kernel traverses over the input sequence, performing a dot product between the kernel and corresponding segments of the data as illustrated in Figure 2 [12]. As a result, this technique enables the model to learn and extract localized features from the sequence without requiring predefined knowledge of their position [13].
Figure 2. The operation of one-dimensional convolution
In recent years, researchers have increasingly recognized the value of incorporating attention mechanisms into deep learning frameworks. These mechanisms simulate a form of human cognitive focus, enabling the model to give more weight to the most relevant segments of input data while minimizing the influence of less informative components. Rather than treating all input equally, attention allows the model to adaptively highlight important features.
This dynamic focus is achieved by using two key types of attention. Temporal attention helps the model identify significant patterns that occur over time, whereas spatial attention emphasizes particular EEG channels that are more informative or responsive in the context of signal classification [14, 15]. These two forms of attention are often implemented together, providing a dual perspective that strengthens the model's capability to capture critical features in both dimensions. When combined with 1D CNN, the attention mechanism becomes even more effective. The 1D CNN serves as the backbone for extracting hierarchical temporal features, while attention modules enhance this by refining the model’s focus, reducing the impact of noise, and improving overall classification outcomes [16].
The primary aim of this study is to construct a high-performance EEG classification model that combines the strengths of both 1D CNNs and attention mechanisms. This hybrid design not only improves the model’s sensitivity to meaningful signal patterns but also strengthens its ability to distinguish between EEG classes with greater precision.
The primary contributions of this study are outlined below:
•A 1D CNN-based framework is developed to learn temporal dynamics in EEG signals by capturing multi-level local features in a hierarchical manner.
•Attention mechanisms are embedded into the CNN structure, enabling the model to emphasize contextually significant regions across time and space, thus improving overall classification accuracy.
•The model’s generalization capabilities are evaluated across multiple EEG categories within the same dataset, demonstrating its effectiveness in practical classification scenarios.
•Attention weights are analyzed to gain interpretability, offering insight into the temporal or spatial elements of the EEG signal that contribute most to classification outcomes.
The rest of the paper is organized as follows: Section 2 summarizes the related works. The dataset is discussed in Section 3. The proposed method is discussed in Section 4. The results and discussion are provided in Section 5. The conclusion of this research is presented in Section 6.
The classification of EEG signals has been the subject of research using various approaches and methodologies. This section reviews and analyzes key studies that have contributed to this domain, with a focus on advancement in dep learning techniques, and the development of expert systems in healthcare, which makes extensive use of deep learning techniques and approaches.
Many researchers have investigated and analyzed various approaches for dealing with EEG signals [17], including feature extraction, feature selection methods [18], and signal preprocessing techniques. Other studies have focused on classification algorithms aimed at enhancing the accuracy of brain-computer interfaces (BCIs) [19]. Machine learning models, especially CNN, have also been widely explored to classify EEG patterns for various applications, such as motor imagery [20], mental workload assessment [21], and emotion recognition [22]. Research indicates that 1D CNN architectures are highly effective in distinguishing distinct cognitive states and neurological conditions. they frequently surpass traditional machine learning models in both classification accuracy and computational efficiency [23]. However, given the wide range of variables that can impact classification outcomes in neurological diagnostics, researchers continue to explore diverse methods to further improve the predictive accuracy of these models.
Jayashekar and Pandian [24] introduced an EEG classification approach that integrates features derived from Common Spatial Pattern (CSP) with Convolutional Neural Networks (CNN). Their classification stage utilized a Multi-Class Support Vector Machine (M-SVM), achieving an accuracy rate of approximately 89.6%. Nonetheless, their method faced challenges when applied to different datasets and was limited in its ability to effectively capture temporal dynamics in EEG signals. These drawbacks suggest more improvements in real-time use and broader applications.
Altaheri et al. [25] developed an attention-based temporal convolutional network (TCN) for classifying EEG signals associated with motor imagery tasks. Their approach included a multi-head self-attention mechanism combined with TCN layers. Although the model demonstrated improvements, its accuracy significantly declined in subject-independent evaluations (70.97%) compared to subject-dependent contexts (85.38%). This discrepancy indicates limited adaptability across diverse users. Furthermore, the model needs extra tuning of settings like attention weights and sliding window parameters, which makes it harder to use for a wider range of applications.
Palanichamy and Ahamed [26] proposed a method based on Time-Aware Convolutional Neural Network integrated with a Recurrent Neural Network (TA-CNN-RNN), aiming for early seizure prediction using EEG data. Their methodology effectively merged spatial feature extraction via CNN with temporal feature modeling through LSTM networks. Despite promising results, the method suffers from considerable limitations. It heavily relies on extensive labeled EEG datasets, which require substantial effort and time to prepare the dataset. Also, the authors did not test whether their model can work well on new patient data or handle noisy EEG signals, which often occur in real clinical settings.
Kumbam and Mary [27] introduced a Cross-Model Attention-Based Deep Learning Framework for epilepsy detection. The model uses a hierarchical cross-model attention mechanism and multivariate LSTM to improve feature representation, achieving an accuracy of 98.84% on the University of Bonn EEG dataset. However, the use of these mechanisms increases computational complexity, and the framework's reliance on carefully tuned hyperparameters may limit its adaptability to different datasets or tasks.
Kode et al. [28] examined the identification of epileptic seizures with EEG signals using machine learning and deep learning techniques. Four classifiers, XGBoost, TabNet, Random Forest, and 1D Convolutional Neural Network (1D-CNN), were assessed on the UCI epileptic seizure recognition dataset, where EEG is modeled as time-series data. The study emphasised preprocessing and feature extraction to improve the performance of the model. The main challenges include the variability of seizure patterns and inter-subject differences.
Rivera et al. [29] address the challenge of multi-class seizure type classification from EEG signals using deep learning. Two compact CNN-based architectures were proposed: Network 1D Raw, applying separable 1D convolutions with dilation to raw EEG, and Network 2D Conv, which uses 2D convolutions on spectrograms. Both models were evaluated on the Temple University Hospital Seizure (TUSZ) dataset with inter-patient 3-fold cross-validation. Results showed weighted F1-scores of 0.611 (1D Raw) and 0.599 (2D Conv), surpassing previous benchmarks. The work highlights the efficiency of separable convolutions and the promise of lightweight CNNs for accurate seizure type classification, while stressing the need for more data on underrepresented seizure categories.
Yuan et al. [30] proposed a hybrid EEG-based seizure prediction framework that combines DenseNet and a Vision Transformer (ViT) with an attention-guided fusion layer. DenseNet extracts spatial features, while ViT models temporal dependencies, and the fusion adaptively integrates both. Evaluated on the CHB-MIT dataset with STFT preprocessing and patient-specific validation, the model achieved 93.65% accuracy and 93.56% sensitivity.
Klein et al. [31] proposed a Flexible Patched Brain Transformer (FPBT) leveraging patch-based tokenization for enhancing the extraction of temporal and spatial features in EEG signals. It achieved a 99.5% accuracy rate in the Bonn dataset and 98.2% in the CHB-MIT dataset, illustrating comparable effectiveness against top models in the literature. In spite of this, the evaluation used already-pre-segmented data, a condition that compromises its generalization in real-time applications.
This study examines the widely recognized Bonn University benchmark dataset, commonly used in epileptic seizure detection studies. The dataset comprises 500 EEG signals recorded from different patients, the dataset captures 23.6 seconds of brain activity per signal, with 4,097 sampled data points, where each point represents the brain's electrical activity over time. To prepare the data for analysis, each signal is divided into 23 one-second intervals, retaining the original label for consistency. Each segment comprises 178 data points. This segmentation results in a total of 11,500 samples categorized into five brain states:
•Seizure activity
•Tumor-affected regions
•Healthy brain regions adjacent to tumors
•Eyes open
•Eyes closed
Before applying the step of classification processing, thorough normalization of feature values was implemented to ensure replicability of training results. One of the main challenges of this dataset is an imbalance of class distribution between seizure and non-seizure classes, with seizure events making up only a small portion of the overall dataset. Without balancing techniques, traditional optimization methods tend to suffer from biases towards predictions of the majority class, resulting in poor sensitivity of seizure prediction. Class weights were used during model training, with increased penalties applied to misclassifications of seizure events. This approach is typical of EEG-based seizure prediction, with attempts being made to encourage class-balanced learning while concurrently focusing on the removal of overfitting [32]. While multiple approaches, including oversampling or synthetic data creation methods such as SMOTE or GAN-based EEG synthesis, are reported in the existing literature, they are not of major interest to this study but offer promising directions for future investigation.
In this regard, this study aims to investigate several machine learning approaches to classifying EEG signals accurately with a focus on improving clinical diagnosis practices as well as introducing automated seizure monitoring systems.
Preprocessing yielded a total number of samples of 11,500 for the following five distinct classes, as shown in Table 1:
Seizure: This is the class of EEG recordings during epileptic seizures. Its samples contain abnormal, high-amplitude, and high-frequency electrical activity of the desynchronized brain.
EEG from Tumor-Affected Areas: This class includes records of EEG signals taken from portions of the brain affected by a tumor. Such signals may have different frequencies, amplitudes, or spatial distributions than those from healthy parts of the brain.
EEG from Healthy Brain Areas Near Tumors: This class includes those EEG signals that were taken from healthy brain areas adjacent to tumor-affected areas. These samples will give a comparison to the tumor-affected EEG signals.
Eyes Open: The class includes those EEG signals that were recorded in a state where the eyes of the subject were open. These samples may exhibit variations in alpha wave activity compared to an eyes-closed state.
Eyes Closed: This class signifies EEG signals recorded for the subject while their eyes were closed. In this condition, generally, more alpha wave activity is noticed within the subject. The dataset is relatively imbalanced, since seizure activity is the smallest in this dataset, considering the number of samples. That means it can be challenging during model training, and one would need to take appropriate techniques to tackle such a class imbalance issue, techniques like class weighting or oversampling.
Table 1. Dataset classes after normalizations
Class Label |
Description |
Number of Samples |
1 |
Epileptic Seizure Activity |
460 |
2 |
EEG from Tumor-Affected Regions |
460 |
3 |
EEG from Nearby Healthy Brain Areas |
460 |
4 |
Eyes Closed EEG Recordings |
460 |
5 |
Eyes Open EEG Recordings |
460 |
Total |
All Classes Combined |
1150 |
This study introduces an innovative attention-based 1D CNN architecture for classifying EEG signals. The approach begins with the pre-processing of raw EEG data. Raw EEG data were sourced from a dataset containing recordings from 500 subjects. Each recording consists of 23.6-second-long and 4097 data points, which are segmented into 1-second intervals, with each segment consisting of 178 data points.
This, in turn, yields 11,500 samples across five different brain states: seizure activity, tumor-affected areas, regions of healthy brain tissue adjacent to the tumors, and states of eyes open and closed. We normalize these features so that our model performs better and improves results while dealing with possible class imbalance.
Our methodology is based on the design of a 1D CNN architecture composed of several convolutional layers. After each convolutional layer, a batch normalization, max-pooling, and dropout operation is applied to prevent overfitting and enhance generalization. An attention mechanism is then incorporated to enable the model to concentrate on the most useful temporal regions of the EEG signal, thereby improving classification performance. By using Adam optimizer, the model is optimized and trained with the sparse categorical cross-entropy loss function.
For the effectiveness of the proposed methodology, metrics such as accuracy, precision, F1-score, Sensitivity, and Specificity have been used along with a confusion matrix for getting detailed performance with respect to each class. Here, we also implement robust validation techniques comprising early stopping and learning rate reduction to optimize the training process.
This study aims to introduce a highly effective and precise framework designed for efficient EEG signal classification for classifying critical states through a well-organized approach that enables neurologists to make more informed decisions using EEG signals.
4.1 EEG signal representation
The EEG signal is modeled as a multivariate time series, segmented into fixed-length intervals of T time steps, each with C channels. In this work, we assume a single-channel configuration, i.e., C=1. Accordingly, each EEG segment is represented as a matrix:
$\chi \in \mathcal{R}^{T \times C}$ (1)
where, T=178T corresponds to the number of time steps per segment, representing a 1-second interval at a sampling rate of 178 Hz, and C=1 denotes the number of EEG channels. These segments are structured into input tensors with shape $11,500 \times 178 \times 1$, where the first dimension represents the number of EEG samples.
4.2 Proposed 1D convolutional neural network
To model the temporal dependencies in EEG signals, we propose an Attention-Driven 1D CNN. This model is designed to learn time-localized features that capture both low-level signal variations and higher-level temporal abstractions, which are critical for discriminating between complex brain states.
The proposed model begins with a 1D convolutional layer consisting of 64 filters and a kernel size of 7, focus on extracting broad temporal features from the input signal. The subsequent step involves applying batch normalization to stabilize training and accelerate convergence. Following this, the output is processed by a max-pooling layer with a pooling window of size 2 in order to reduce temporal resolution while preserving key signal characteristics. Subsequently, a dropout layer with a dropout rate of 0.3 is employed to mitigate overfitting.
This pattern, which consists of convolution, normalization, pooling, and dropout, is repeated in two additional blocks.
In the second block, the number of filters is increased to 128 with a kernel size of 5, while the third block utilizes 256 filters with a kernel size of 3. Each block consistently includes batch normalization, max-pooling, and dropout with the same previous configuration. This deep stack enables the extraction of increasingly abstract temporal patterns from the EEG signal.
Mathematically, the output of a 1D convolutional layer at position i, given an input sequence X, kernel $W \in \mathcal{R}^\kappa$ (where k is kernel size) and bias $b \in \mathbb{R}$ is calculated as:
$F_i=f\left(\sum_{j=0}^{k-1} X_{i+j} . W_j+b\right)$ (2)
where:
$F_i$ represents the output value at position i,
$X_{i+j}$ is the input value at index i+j,
$W_j$ is the j-th weight in the convolutional kernel,
f(.) denotes a nonlinear activation function such as ReLU.
4.3 Attention mechanism
To enhance the model’s discriminative capacity, particularly in handling temporally diffuse or noisy EEG segments, a temporal attention mechanism is introduced after the final convolutional block. This mechanism allows the model to emphasize the most informative regions of the time series for classification.
Given a feature map $\mathrm{F} \in \mathcal{R}^{T \times D}$ produced by the final convolutional layer, where T denotes the number of time steps and D represents the feature dimensionality (or filter depth), the attention mechanism computes a set of weights $\alpha \in \mathcal{R}^T$, which reflect the importance of each time step. Each attention weight $\alpha_t$ is computed using:
$\alpha_t=\frac{\exp \left(v^T \tanh \left(W \cdot F_t\right)\right)}{\sum_{n=1}^T \exp \left(v^T \tanh \left(W \cdot F_{\grave{t}}\right)\right)}$ (3)
where:
$F_t \in \mathcal{R}^T$ is the feature vector at time step t,
$W \in \mathcal{R}^{D \times D}$ and $v \in \mathcal{R}^D$ are trainable parameters of the attention mechanism,
tanh(.) is the hyperbolic tangent nonlinearity,
$\alpha_t \in[0,1]$ represents the normalized attention score for time step t.
The final context vector $C \in \mathcal{R}^D$ is computed as a weighted sum over the time-step features:
$C=\sum_{t=1}^T \alpha t \cdot F_t$ (4)
where:
c: attention-weighted context vector ($\mathbb{R}^D$).
$a_t$: attention weight.
$\mathrm{F}_{\mathrm{t}}$: feature vector at time step t.
T: sequence length.
In the current research, the WW and vv attention parameters are initialized using the Xavier/Glorot scheme, which is well-suited for the tanh activation function used in the incorporated scoring mechanism. The bias term bₐ is set to zero. This initialization practice is designed to reduce tanh saturation, improve the stability of gradient propagation, and foster better stability with faster convergence, consistent with the findings reported by Glorot and Bengio [33]. Recent studies proposed initialization methods specifically designed for the tanh activation function, with results showing that they produce stable fixed points, reduce vanishing and exploding gradients issues, and allow for more reliable and faster convergence compared to the standard Xavier initialization [34]. The overall architecture of the proposed framework is illustrated in the system block diagram shown in Figure 3.
Figure 3. The proposed system block diagram
4.4 Post-attention classification
The context vector is passed through a global average pooling layer, which aggregates temporal activations, and then into two fully connected layers. The initial dense layer consists of 128 units activated by ReLU, followed by a dropout layer with a rate of 0.4. Subsequently, the second dense layer comprises 64 units, accompanied by a dropout layer with the same rate.
Finally, the output layer is a softmax classifier with five units, corresponding to the five target EEG classes.
The model is trained end-to-end using the Adam optimizer (learning rate = 0.001) and sparse categorical cross-entropy loss. This unified architecture effectively integrates temporal feature extraction, attention-based weighting, and classification within a single framework optimized for EEG signal analysis.
The full forward and training procedure is described in the following algorithm, and the corresponding architecture is detailed in Table 2.
Algorithm: EEG signal classification using attention-enhanced 1D CNN
Input: EEG tensor $\chi \in \mathcal{R}^{T \times C}$, and corresponding class labels Y
Output: Predicted class labels $\hat{Y}$ and classification performance metrics
Step 1: Preprocessing
Apply bandpass filtering to remove noise and artifacts.
Normalize each EEG channel to zero mean and unit variance.
Pad or truncate signals to fixed length T = 178.
Reshape input as X → (N, 178, 1).
Step 2: Convolutional Feature Extraction
Conv1D: 64 filters, kernel size = 7.
Batch Normalization.
MaxPooling1D: pool size = 2.
Dropout: rate = 0.3.
Repeat for Layer 2: 128 filters, kernel size = 5.
Repeat for Layer 3: 256 filters, kernel size = 3.
Step 3: Attention Mechanism
Let $W \in \mathcal{R}^{T x D}$ be the output feature map from the final Conv1D layer.
Compute attention weights $\alpha_t$ using:
$\alpha_t=\frac{\exp \left(v^T \tanh \left(W \cdot F_t\right)\right)}{\sum_{v=1}^T \exp \left(v^T \tanh \left(W \cdot F_{\dot{t}}\right)\right)}$
Compute context vector c as:
$C=\sum_{t=1}^T \alpha t \cdot F_t$
Step 4: Classification Head
Apply GlobalAveragePooling1D.
Dense: 128 units, ReLU → Dropout (0.4).
Dense: 64 units, ReLU → Dropout (0.4).
Output: Dense layer with 5 units, Softmax activation.
Step 5: Model Training
Optimizer: Adam (learning rate = 0.001).
Loss: Sparse categorical cross-entropy.
Batch size: 32, Epochs: 50.
Early stopping based on validation loss.
Metrics: Accuracy, Precision, Recall, F1-score, Confusion Matrix.
Table 2. Layer-wise architecture of the proposed model
Layer Type |
Parameters |
Description |
Input Layer |
Shape: (178, 1) |
EEG segment with 178 time steps and 1 channel |
Conv1D Layer 1 |
Filters: 64, Kernel Size: 7 |
Captures broad temporal features |
Batch Normalization |
- |
Normalizes activations |
MaxPooling1D Layer 1 |
Pool Size: 2 |
Downsamples temporal resolution |
Dropout Layer 1 |
Rate: 0.3 |
Prevents overfitting |
Conv1D Layer 2 |
Filters: 128, Kernel Size: 5 |
Learns mid-level features |
Batch Normalization |
- |
- |
MaxPooling1D Layer 2 |
Pool Size: 2 |
- |
Dropout Layer 2 |
Rate: 0.3 |
- |
Conv1D Layer 3 |
Filters: 256, Kernel Size: 3 |
Extracts deeper temporal features |
Batch Normalization |
- |
- |
MaxPooling1D Layer 3 |
Pool Size: 2 |
- |
Dropout Layer 3 |
Rate: 0.3 |
- |
Attention Mechanism |
Trainable W, v |
Focuses on the most informative time steps |
GlobalAveragePooling1D |
- |
Aggregates time-weighted features |
Dense Layer 1 |
128 units, ReLU |
Learns abstract representations |
Dropout Layer 4 |
Rate: 0.4 |
Prevents overfitting |
Dense Layer 2 |
64 units, ReLU |
Refines decision space |
Dropout Layer 5 |
Rate: 0.4 |
- |
Output Layer |
5 units, Softmax |
Outputs class probabilities for EEG states |
The proposed model was implemented using Python and TensorFlow 2.x on a machine equipped with an NVIDIA GPU (e.g., RTX 3080), 32 GB RAM, and running Ubuntu 20.04. The experiments utilized a dataset of 11,500 single-channel EEG segments, each represented as a 1-second recording sampled at 178 Hz, yielding input arrays of shape (178,1)(178, 1)(178,1). The signals were preprocessed using bandpass filtering to remove noise and artifacts, and subsequently normalized to have zero mean and unit variance.
The dataset was partitioned into training (70%), validation (15%), and testing (15%) subsets through stratified random sampling to maintain the original class distribution. Each segment was padded or truncated to maintain a consistent temporal length of 178 samples. The model was trained using the Adam optimizer with a learning rate of 0.001, minimizing sparse categorical cross-entropy loss.
Training was conducted for a maximum of 50 epochs with a batch size of 32, and early stopping was applied based on validation loss to prevent overfitting. Regularization in the model was introduced through dropout layers with rates of 0.3 in the convolutional blocks and 0.4 in the dense layers.
The selection of all hyperparameters, including filter sizes, kernel widths, and dropout rates, was guided by prior knowledge of the domain and refined iteratively based on validation performance. For model evaluation, five different performance metrics were used: accuracy, precision, recall, F1-score, and confusion matrix analysis.
The model’s performance was assessed using a separate test set that had not been exposed during either training or validation. To evaluate its effectiveness, four standard metrics were applied: accuracy, precision, recall, and F1-score. These measures provided a balanced view of the model’s predictive strength and its ability to perform reliably across different EEG classes.
The model showed strong performance across most of the evaluation metrics, and it was especially effective when it came to detecting seizure-related activity. This result was further supported by the confusion matrix, which clearly showed that seizure events were well-separated from other brain states, as illustrated in Figure 4. This suggests the model was able to learn features that vary over time quite well. Overall, the results make a good case for including temporal attention in CNN-based architectures, since it helps guide the model to focus more on the parts of the EEG signals that matter the most for the task.
The training process was also monitored using learning curves for both accuracy and loss. These curves showed a generally stable convergence pattern, with no obvious signs of overfitting. That suggests the overall model setup—particularly the use of dropout and early stopping—was fairly well-suited to the characteristics of the dataset. It looks like the regularization choices helped keep the model from memorizing noise during training.
While the model performed well overall, a few limitations were still noted. In particular, there were more frequent misclassifications between tumor-related EEG patterns and those from normal brain activity. This may be due to some degree of overlap in their temporal or spectral features. It’s a known issue in EEG classification, where similar signals across different classes—and high variability within the same class—often make it harder for models to draw clear decision boundaries.
(a) Confusion matrix of the proposed attention-enhanced 1D CNN model
(b) Confusion matrix of the baseline 1D CNN model without attention
Figure 4. Confusion matrix comparison: attention-augmented vs. baseline 1D CNN models
These results suggest a few useful directions for future work. For instance, incorporating prior knowledge from the domain, using multimodal inputs, or trying out class-sensitive loss functions might help improve performance further. Also, the way the attention weights behave seems promising from an interpretability standpoint, especially when it comes to clinical use—like spotting seizure onset zones or identifying pre-ictal activity more clearly.
The proposed model showed significant effectiveness in classification performance, as supported through validation with new data, and has potential for real-time monitoring of cortical activity. It effectively distinguished activities related to seizure events; however, more work is needed to improve discrimination in situations where clinical features show high correlation.
Table 3. Performance metrics for EEG classification using the attention-enhanced 1D CNN model
Class |
Accuracy |
Precision |
F1-Score |
Seizure |
0.9978 |
0.9935 |
0.9946 |
Tumor |
0.9274 |
0.8277 |
0.8159 |
Nearby Healthy |
0.9291 |
0.8235 |
0.8226 |
Eyes Closed |
0.9922 |
0.9763 |
0.9805 |
Eyes Open |
0.9935 |
0.9744 |
0.9839 |
Table 4. Sensitivity and specificity for the attention-enhanced 1D CNN model
Class |
Sensitivity (Recall) |
Specificity |
Seizure |
0.9957 |
0.9984 |
Tumor |
0.8043 |
0.9582 |
Nearby Healthy |
0.8217 |
0.9560 |
Eyes Closed |
0.9848 |
0.9940 |
Eyes Open |
0.9935 |
0.9935 |
Table 5. Performance metrics for EEG classification using the baseline 1D CNN model (without attention)
Class |
Accuracy |
Precision |
F1-Score |
Seizure |
0.9848 |
0.9512 |
0.9624 |
Tumor |
0.9135 |
0.7856 |
0.7830 |
Nearby Healthy |
0.9148 |
0.7946 |
0.7841 |
Eyes Closed |
0.9752 |
0.9315 |
0.9385 |
Eyes Open |
0.9770 |
0.9453 |
0.9422 |
Table 6. Sensitivity and specificity for the baseline 1D CNN model (without attention)
Class |
Sensitivity (Recall) |
Specificity |
Seizure |
0.9739 |
0.9875 |
Tumor |
0.7804 |
0.9467 |
Nearby Healthy |
0.7739 |
0.9500 |
Eyes Closed |
0.9457 |
0.9826 |
Eyes Open |
0.9391 |
0.9864 |
The comparative evaluation of confusion matrices demonstrates that the integration of an attention mechanism significantly enhances classification performance. Without attention, the model exhibits substantial misclassifications—particularly between overlapping classes—due to insufficient feature localization. With attention, class-wise separability improves, error rates decline, and both sensitivity and specificity increase across multiple categories. These improvements reflect attention’s capacity to guide the model toward salient, discriminative features, resulting in more accurate and balanced predictions. Collectively, the findings affirm that attention is not merely an auxiliary component but a critical architectural enhancement for robust and interpretable classification systems.
In summary, the empirical evidence drawn from the comparative confusion matrix analysis affirms the efficacy of the attention mechanism in enhancing both the discriminative power and generalization capacity of the model. By enabling focused feature extraction and suppressing irrelevant input regions, attention leads to more accurate, balanced, and interpretable predictions. These results substantiate the inclusion of attention as a key architectural component in high-performance classification systems where robustness and precision are paramount. The detailed performance outcomes, including accuracy, precision, recall, F1-score, sensitivity, and specificity for both the attention-enhanced and baseline 1D CNN models, are summarized in Tables 3-6.
The experimental results clearly demonstrate the performance superiority of the attention-enhanced 1D CNN model over its baseline counterpart across nearly all classification metrics. Notably, the model with attention achieves significantly higher accuracy, precision, and F1-scores for the majority of EEG classes, particularly in challenging categories such as Tumor and Nearby Healthy. This improvement is further substantiated by elevated sensitivity and specificity scores, indicating enhanced discriminative power and a reduced false positive rate.
The Seizure and Eyes Open classes exhibit the highest classification metrics in both models; however, the attention-based architecture further refines these outcomes, achieving a near-perfect classification with sensitivity exceeding 0.99. This suggests that the attention mechanism effectively emphasizes salient temporal-spatial features critical to pathological signal characterization.
The largest gains are observed in mid-difficulty classes—Tumor and Nearby Healthy—where the attention mechanism contributes to a marked reduction in misclassifications. For instance, the F1-score for Tumor increases from 0.7830 to 0.8159, and sensitivity improves from 0.7804 to 0.8043. Although modest, these increments are clinically meaningful given the subtle spectral differences that define these categories in EEG signals.
Despite these improvements, the attention-based model still lags in performance on the Tumor and Nearby Healthy classes compared to Seizure and Eyes Open, revealing remaining challenges in detecting classes with more heterogeneous signal profiles. This suggests a potential avenue for further refinement, such as incorporating class-specific attention weighting or multi-branch feature encoding.
In summary, the experimental results confirm that integrating a temporal attention mechanism into the 1D CNN architecture enhances EEG classification performance, yielding improvements in both sensitivity and specificity. The model shows notable advantages in distinguishing tumor-related signals from healthy tissue, an area often prone to misclassification. Confusion matrices and class-wise evaluation metrics further support these findings, demonstrating reduced inter-class ambiguity and improved diagnostic precision.
The effectiveness of the proposed model was further validated through training and validation loss and accuracy curves over 50 epochs (Figures 5-7). Figures 5 and 6 show that the attention-based model achieves smoother convergence and higher accuracy, while Figure 7 illustrates a lower and more stable validation loss compared to the non-attention model, indicating better generalization. As reported in Table 7, the proposed method delivers accuracy, sensitivity, and specificity that are competitive with, and in several cases superior to, other state-of-the-art models published between 2020 and 2025, underscoring its robustness for EEG signal classification.
Table 7. Comparison of the proposed model with existing methods in terms of accuracy, sensitivity, and specificity
References |
Methods |
Accuracy |
Sensitivity |
Specificity |
[35] |
DCNN |
0.926 |
0.926 |
0.971 |
[36] |
DWT |
0.975 |
/ |
/ |
[37] |
CNN/ LSTM |
/ |
0.93 |
0.925 |
[38] |
TQWT |
0.9971 |
/ |
/ |
[39] |
ADLBSC-ESD |
0.8609 |
0.652 |
0.913 |
[26] |
CNN-RNN |
0.924 |
/ |
/ |
[40] |
SVM |
0.965 |
0.984 |
0.956 |
[41] |
LS-SVM, KNN, and NB |
0.995 |
0.991 |
1.0 |
[42] |
DAGSVM |
0.9971 |
0.9971 |
0.9971 |
[43] |
ML-LSTM |
0.971 |
0.97 |
0.99 |
[44] |
Statistical Features |
0.928 |
0.925 |
0.93 |
[45] |
CNN-LSTM |
0.9518 |
0.9516 |
0.9516 |
Proposed method |
Attention-enhanced 1D CNN |
0.9978 |
0.9957 |
0.9984 |
Figure 5. Training and validation accuracy curves for the proposed model without attention mechanism
Figure 6. Training and validation accuracy curve for the proposed model with attention mechanism
Figure 7. Training and validation loss curve for the proposed model with and without attention mechanism
Computational efficiency metrics (e.g., training time, FLOPs) are not included here since they were not reported in prior studies, preventing direct comparison. This aspect will be investigated in future work.
In this study, an attention-enhanced one-dimensional convolutional neural network (1D CNN) was proposed for EEG signal classification, aiming to improve the accuracy and generalization ability of EEG-based diagnostics through the integration of temporal attention mechanisms. The experimental results demonstrate that deep learning techniques, particularly attention-augmented 1D CNNs, are highly promising for automating EEG signal analysis and enhancing clinical diagnostic capabilities. The proposed model achieved excellent performance, reaching an accuracy of 99.78% in detecting epileptic seizure activity. It also demonstrated high classification performance in distinguishing eyes-open and eyes-closed states, with accuracies of 99.35% and 99.22%, respectively. For tumor tissue identification, the model achieved accuracies of 92.74% for tumor regions and 92.91% for adjacent healthy tissue. However, separating tumor from normal tissue in EEG measurements is highly challenging. Tumor-affected signals often resemble normal activity near lesions in both spectral and temporal patterns, while inter- and intra-patient variability further obscures discriminative features. In addition, the scarcity of tumor-labeled EEG data compared to seizure data reinforces class imbalance and limits model generalization.
Potential methodologies include multimodal input integration (such as the combination of EEG with MRI or fMRI), the combination of features at spectral, temporal, and connectivity levels, and the use of advanced learning architectures like transfer learning, domain adaptation, or attention-based approaches. Synthetic data generation (like data augmentation using GANs) can also be used to counter imbalances and improve robustness.
The integration of these approaches holds promise for enhancing differentiation between neoplastic and non-neoplastic tissues, thereby strengthening clinical decision-making in neuro-oncology.
Beyond classification accuracy, the proposed model holds clinical value through its potential for real-time EEG monitoring. This capability could enable earlier detection of abnormal activity, support timely interventions, and assist clinicians in improving patient outcomes.
[1] Dong, Z.H., Florenly, Nasution, A.N. (2024). The role of imaging in modern medical science: Techniques, applications, and future directions. Frontiers in Health Informatics, 13(3): 3976-3988.
[2] Murala, D.K., Panda, S.K., Dash, S.P. (2023). MedMetaverse: Medical care of chronic disease patients and managing data using artificial intelligence, blockchain, and wearable devices state-of-the-art methodology. IEEE Access, 11: 138954-138985. https://doi.org/10.1109/ACCESS.2023.3340791
[3] Rasheed, K., Qayyum, A., Qadir, J., Sivathamboo, S., Kwan, P., Kuhlmann, L., O'Brien, T., Razi, A. (2021). Machine learning for predicting epileptic seizures using EEG signals: A review. IEEE Reviews in Biomedical Engineering, 14: 139-155. https://doi.org/10.1109/RBME.2020.3008792
[4] Amer, N.S., Belhaouari, S.B. (2023). EEG signal processing for medical diagnosis, healthcare, and monitoring: A comprehensive review. IEEE Access, 11: 143116-143142. https://doi.org/10.1109/ACCESS.2023.3341419
[5] Yauri, J., Lagos, M., Vega-Huerta, H., De-La-Cruz-VdV, P., Maquen-Ni˜no, G.L.E., Condor-Tinoco, E. (2023). Detection of epileptic seizures based-on channel fusion and transformer network in EEG recordings. International Journal of Advanced Computer Science and Applications, 14(5). https://doi.org/10.14569/IJACSA.2023.01405110
[6] Altaheri, H., Muhammad, G., Alsulaiman, M., Amin, S.U., Altuwaijri, G.A., Abdul, W., Bencherif, M.A., Faisal, M. (2023). Deep learning techniques for classification of electroencephalogram (EEG) motor imagery (MI) signals: A review. Neural Computing and Applications, 35: 14681-14622. https://doi.org/10.1007/s00521-021-06352-5
[7] Rajwal, S., Aggarwal, S. (2023). Convolutional neural network-based EEG signal analysis: A systematic review. Archives of Computational Methods in Engineering, 30: 3585-3615. https://doi.org/10.1007/s11831-023-09920-1
[8] Yaseen, S.F., Al-Araji, A.S., Humaidi, A.J. (2022). Brain tumor segmentation and classification: A one-decade review. International Journal of Nonlinear Analysis and Applications, 13(2): 1879-1891. https://doi.org/10.22075/IJNAA.2022.27445.3601
[9] Yaseen, S.F., Humaidi, A.J., Al-Araji, A.S., Al-Raweshidy, H.S. (2024). Multi-Graded Brain Tumor Classification Using Yolov7. Iraqi Journal of Computers, Communications, Control and Systems Engineering, 24(3): 59-76. https://doi.org/10.33103/uot.ijccce.24.3.5
[10] Ahmed, A.A., Ali, W., Abdullah, T.A.A., Malebary, S.J. (2023). Classifying cardiac arrhythmia from ECG signal using 1D CNN deep learning model. Mathematics, 11(3): 562. https://doi.org/10.3390/math11030562
[11] Ige, A.O., Sibiya, M. (2024). State-of-the-art in 1D convolutional neural networks: A survey. IEEE Access, 12: 144082-144105. https://doi.org/10.1109/ACCESS.2024.3433513
[12] Shetty, A.M., Fadhel Aljunid, M., Manjaiah, D.H. (2024). Unleashing the power of 2D CNN with attention and pre-trained embeddings for enhanced online review analysis. International Journal of Computers and Applications, 46(1): 46-57. https://doi.org/10.1080/1206212X.2023.2283647
[13] Zhou, K., Haimudula, A., Tang, W.Y. (2024). Dual-branch convolution network with efficient channel attention for EEG-based motor imagery classification. IEEE Access, 12: 74930-74943. https://doi.org/10.1109/ACCESS.2024.3404634
[14] Liu, Y.P., Wang, J.W. (2024). Personal protective equipment detection for construction workers: A novel dataset and enhanced YOLOv5 approach. IEEE Access, 12: 47338-47358. https://doi.org/10.1109/ACCESS.2024.3382817
[15] Su, E.Z., Cai, S.Q., Xie, L.H., Li, H.Z., Schultz, T. (2022). STAnet: A spatiotemporal attention network for decoding auditory spatial attention from EEG. IEEE Transactions on Biomedical Engineering, 69(7): 2233-2242. https://doi.org/10.1109/TBME.2022.3140246
[16] Cai, S.Q., Su, E.Z., Xie, L.H., Li, H.Z. (2022). EEG-based auditory attention detection via frequency and channel neural attention. IEEE Transactions on Human-Machine Systems, 52(2): 256-266. https://doi.org/10.1109/THMS.2021.3125283
[17] Rui, Z.P., Gu, Z.Y. (2021). A review of EEG and fMRI measuring aesthetic processing in visual user experience research. Computational Intelligence and Neuroscience, 2021: 2070209. https://doi.org/10.1155/2021/2070209
[18] Aquino-Brítez, D., Ortiz, A., Ortega, J., León, J., Formoso, M., Gan, J.Q., Escobar, J.J. (2021). Optimization of deep architectures for EEG signal classification: An automl approach using evolutionary algorithms. Sensors, 21(6): 2096. https://doi.org/10.3390/s21062096
[19] Ein Shoka, A.A., Dessouky, M.M., El-Sayed, A., Hemdan, E.E.D. (2023). EEG seizure detection: Concepts, techniques, challenges, and future trends. Multimedia Tools and Applications, 82: 42021-42051. https://doi.org/10.1007/s11042-023-15052-2
[20] Echtioui, A., Mlaouah, A., Zouch, W., Ghorbel, M., Mhiri, C., Hamam, H. (2021). A novel convolutional neural network classification approach of motor-imagery EEG recording based on deep learning. Applied Sciences, 11(21): 9948. https://doi.org/10.3390/app11219948
[21] Pušica, M., Kartali, A., Bojović, L., Gligorijević, I., Jovanović, J., Leva, M.C., Mijović, B. (2024). Mental workload classification and tasks detection in multitasking: Deep learning insights from EEG study. Brain Sciences, 14(2): 149. https://doi.org/10.3390/brainsci14020149
[22] Fernandes, J.V.M.R., Alexandria, A.R.D., Marques, J.A.L., Assis, D.F.D., Motta, P.C., Silva, B.R.D.S. (2024). Emotion detection from EEG signals using machine deep learning models. Bioengineering, 11(8): 782. https://doi.org/10.3390/bioengineering11080782
[23] Kiranyaz, S., Avci, O., Abdeljaber, O., Ince, T., Gabbouj, M., Inman, D.J. (2021). 1D convolutional neural networks and applications: A survey. Mechanical Systems and Signal Processing, 151: 107398. https://doi.org/10.1016/j.ymssp.2020.107398
[24] Jayashekar, V., Pandian, R. (2022). Hybrid feature extraction for EEG motor imagery classification using multi-class SVM. International Journal of Intelligent Engineering & Systems, 15(4). https://doi.org/10.22266/ijies2022.0831.03
[25] Altaheri, H., Muhammad, G., Alsulaiman, M. (2022). Physics-informed attention temporal convolutional network for EEG-based motor imagery classification. IEEE Transactions on Industrial Informatics, 19(2): 2249-2258. https://doi.org/10.1109/TII.2022.3197419
[26] Palanichamy, I., Ahamed, F.B.B. (2022). Prediction of seizure in the EEG signal with time aware recurrent neural network. Revue d'Intelligence Artificielle, 36(5): 717-724. https://doi.org/10.18280/ria.360508
[27] Kumbam, V.R., Mary, A.V.A. (2023). Cross model attention based deep learning for multi modal epilepsy detection. International Journal of Intelligent Engineering & Systems, 16(5). https://doi.org/10.22266/ijies2023.1031.07
[28] Kode, H., Elleithy, K., Almazaydeh, L. (2024). Epileptic seizure detection in EEG signals using machine learning and deep learning techniques. IEEE Access, 12: 80657-80668. https://doi.org/10.1109/ACCESS.2024.3409581
[29] Rivera, M.J., Sanchis, J., Corcho, O., Teruel, M.A., Trujillo, J. (2024). Evaluating CNN methods for epileptic seizure type classification using EEG data. IEEE Access, 12: 75483-75495. https://doi.org/10.1109/ACCESS.2024.3406332
[30] Yuan, S.S., Yan, K.T., Wang, S.H., Liu, J.X., Wang, J. (2024). EEG-based seizure prediction using hybrid DenseNet–ViT network with attention fusion. Brain Sciences, 14(8): 839. https://doi.org/10.3390/brainsci14080839
[31] Klein, T., Minakowski, P., Sager, S. (2025). Flexible Patched Brain Transformer model for EEG decoding. Scientific Reports, 15: 10935. https://doi.org/10.1038/s41598-025-86294-3
[32] Yuan, Q., Zhou, W., Zhang, L., Zhang, F., Xu, F., Leng, Y., Chen, M. (2017). Epileptic seizure detection based on imbalanced classification and wavelet packet transform. Seizure, 50: 99-108.
[33] Glorot, X., Bengio, Y. (2010). Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 249-256.
[34] Lee, H., Choi, H. Kim, H. (2024). Robust weight initialization for tanh neural networks with fixed point analysis. arXiv preprint arXiv:2410.02242. https://doi.org/10.48550/arXiv.2410.02242
[35] Gao, Y., Gao, B., Chen, Q., Liu, J., Zhang, Y. (2020). Deep convolutional neural network-based epileptic electroencephalogram (EEG) signal classification. Frontiers in Neurology, 11: 375. https://doi.org/10.3389/fneur.2020.00375
[36] Moctezuma, L.A., Molinas, M. (2020). EEG channel-selection method for epileptic-seizure classification based on multi-objective optimization. Frontiers in Neuroscience, 14: 593. https://doi.org/10.3389/fnins.2020.00593
[37] Usman, S.M., Khalid, S., Bashir, Z. (2021). Epileptic seizure prediction using scalp electroencephalogram signals. Biocybernetics and Biomedical Engineering, 41(1): 211-220. https://doi.org/10.1016/j.bbe.2021.01.001
[38] Malekzadeh, A., Zare, A., Yaghoobi, M., Kobravi, H.R., Alizadehsani, R. (2021). Epileptic seizures detection in EEG signals using fusion handcrafted and deep learning features. Sensors, 21(22): 7710. https://doi.org/10.3390/s21227710
[39] Escorcia-Gutierrez, J., Beleno, K., Jimenez-Cabas, J., Elhoseny, M., Alshehri, M.D., Selim, M.M. (2022). An automated deep learning enabled brain signal classification for epileptic seizure detection on complex measurement systems. Measurement, 196: 111226. https://doi.org/10.1016/j.measurement.2022.111226
[40] Al-jumaili, S., Duru, A.D., Ibrahim, A.A., Uçan, O.N. (2023). Investigation of epileptic seizure signatures classification in EEG using supervised machine learning algorithms. Traitement du Signal, 40(1): 43-54. https://doi.org/10.18280/ts.400104
[41] Dastgoshadeh, M., Rabiei, Z. (2023). Detection of epileptic seizures through EEG signals using entropy features and ensemble learning. Frontiers in Human Neuroscience, 16: 1084061. https://doi.org/10.3389/fnhum.2022.1084061
[42] Babu, S., Wadhwani, A.K. (2024). Epilepsy diagnosis using directed acyclic graph SVM technique in EEG signals. Traitement du Signal, 41(6): 3163-3172. https://doi.org/10.18280/ts.410632
[43] Kunekar, P., Gupta, M.K., Gaur, P. (2024). Detection of epileptic seizure in EEG signals using machine learning and deep learning techniques. Journal of Engineering and Applied Science, 71: 21. https://doi.org/10.1186/s44147-023-00353-y
[44] Choubey, H., Raghuwanshi, S.S., Arya, H., Saxena, P., Jha, J., Sharma, S. (2025). Classification and detection of epileptic seizures based on statistical features and autoregressive model. Traitement du Signal, 42(1): 79-85. https://doi.org/10.18280/ts.420108
[45] Huang, Z.T., Yang, Y.Y., Ma, Y.H., Dong, Q., Su, J.Y., Shi, H.Y., Zhang, S.W., Hu, L.L. (2025). EEG detection and recognition model for epilepsy based on dual attention mechanism. Scientific Reports, 15: 9404. https://doi.org/10.1038/s41598-025-90315-6