Skip to content

Original Research

Frontiers in Computational Neuroscience ·

Volume 20 - 2026 | https://doi.org/10.3389/fncom.2026.1949040

An attention-enhanced hybrid CNN-BiLSTM framework for multiclass epileptic seizure recognition using EEG signals

  • Bobbinpreet Kaur1
  • Sheenam Middha1
  • Aleem Ali1
  • Noman Khan2*corresponding author
  • Reham Alhejaili3
  • Ahmed H. Almutairi4
  1. 1Department of Computer Science and Engineering, University Institute of Engineering (UIE) Chandigarh University, Gharuan, Punjab, India
  2. 2Department of Computer Science and Engineering, Sejong University, Seoul, Republic of Korea
  3. 3Department of Computer Science and Artificial Intelligence, College of Computer Science and Engineering, University of Jeddah, Jeddah, Saudi Arabia
  4. 4Department of Computer Science, Applied College, Northern Border University, Arar, Saudi Arabia
Article metrics0 viewsView details

Abstract

Electroencephalogram (EEG) signal classification plays a pivotal role in brain-computer interfaces (BCIs) and the diagnosis of neurological disorders. However, the non-stationary, non-linear, and low signal-to-noise ratio characteristics of EEG signals make accurate feature extraction challenging. Conventional deep learning approaches often struggle to simultaneously capture localized transient patterns, deep temporal dependencies, and long-range contextual relationships within EEG signals. To address these challenges, an optimized end-to-end hybrid deep learning framework, termed CNN–BiLSTM–MHSA, is proposed for multiclass epileptic seizure recognition. The architecture sequentially integrates a multilayer one-dimensional Convolutional Neural Network (CNN) for localized feature extraction, a Bidirectional Long Short-Term Memory (BiLSTM) network for capturing forward and backward temporal dependencies, and a Multi-Head Self-Attention (MHSA) mechanism for dynamically emphasizing discriminative neurological events. Robust preprocessing includes Butterworth bandpass filtering, Z-score normalization, and data augmentation using Gaussian noise injection and amplitude scaling. The framework was evaluated on the UCI/Kaggle Epileptic Seizure Recognition dataset comprising 11,500 EEG segments distributed across five classes. The proposed framework achieved an overall accuracy of 98.83%, precision of 98.95%, recall (sensitivity) of 98.84%, F1-score of 98.90%, specificity of 99.71%, balanced accuracy of 98.84%, ROC-AUC of 99.80%, and PR-AUC of 99.72%. Class-wise accuracies exceeded 99% for most categories, with one seizure class achieving perfect recognition. Comparative evaluation further demonstrated that the proposed framework outperformed several recent state-of-the-art EEG seizure classification methods. The superior performance can be attributed to the complementary representation capabilities of the hybrid architecture. CNN layers effectively learn localized signal patterns, BiLSTM captures bidirectional temporal dependencies, and MHSA enhances the representation of long-range contextual relationships by assigning greater importance to informative temporal regions. The combination of robust preprocessing and data augmentation further contributes to improved generalization and classification reliability.

Keywords

1 Introduction

EEG is a non-invasive neuroimaging technique that measures the brain's high temporal resolution electric activity. In the clinical environment, EEG signals are essential in anesthetic monitoring, epilepsy diagnosis and assessing altered states of consciousness (Raghu et al., 2020). Manual interpretation of EEG by trained neurologist is subject to fatigue-induced error and subjective, time consuming. In this regard, automated EEG analysis based on machine learning and deep learning has gained a lot of research interest. One of the most important aspects to patient safety is the ability to detect seizures accurately and timely. Likewise, accurate monitoring of anesthesia status prevents awareness during anesthesia, which is linked with post-traumatic stress disorder and patient outcome (Martins et al., 2026). The monitoring of depth of anesthesia by EEG has thus become a major part of contemporary perioperative management. Although these developments are significant, automated EEG signal analysis is still a daunting task. EEG signals are characterized by low amplitude (typically 10–100 microvolts), sensitivity to artifacts (eye movements, muscle activity, electrode noise), high inter-subject and intra-session variability and complex non-stationary temporal dynamics that span multiple frequency bands. The traditional feature engineering methods, which involve manually designed features like power spectral density, wavelet coefficients, or common spatial patterns, are time-consuming, task-specific, and may not fully account for the complexity of EEG spatiotemporal data. With the emergence of deep learning, a paradigm shift has taken place in the processing of EEG signals. Convolutional Neural Networks are known to be good at extracting local spatial and spectral features with learned filter banks, and Recurrent Neural Networks (RNNs), specifically Long Short-Term Memory (LSTM) networks, are capable of capturing the sequential temporal dependencies that are present in EEGs time-series. Recently, transformer-based attention mechanisms have been shown to have better performance in selectively attending to the most relevant temporal features for a given task, overcoming the inability of RNNs to attend to different parts of their context window. The conventional EEG classification methods like support vector machine (SVM) and linear discriminant analysis (LDA) rely on hand-crafted feature engineering, but they cannot reflect the non-linear, non-stationary dynamics of EEG signals (Arshath and Karthikeyan, 2026). In contrast to deep learning architectures, these are architectures that rely on a human-designed hierarchy to extract features directly from raw signals. CNNs are good at learning local temporal structure, while LSTM networks are good at learning long-range temporal structure. However, there are drawbacks to architectures that do not rely on connection to one another: CNNs have no notion of temporal context, and recurrent networks are inefficient in processing long sequences. Hybrid models of CNNs and recurrent layers, have shown better results on EEG classification tasks (Lashkari et al., 2026). Additionally, the addition of attention mechanisms allows models to attend to clinically relevant temporal regions, leading to greater classification accuracy and interpretability (Zhai et al., 2026). Although these progress have been made, existing work has not yet explored a comprehensive framework that combines advanced preprocessing, CNN feature extraction, Bidirectional LSTM temporal modeling, multi-head self-attention, and cross-classification with extensive cross-validation schemes for multi-class EEG consciousness classification (Tiwari et al., 2026).

The novelty of this study lies in the development of a unified CNN–BiLSTM–Multi-Head Self-Attention framework that jointly models local EEG characteristics, bidirectional temporal dependencies, and long-range contextual relationships. Unlike conventional CNN-based approaches that primarily learn local signal representations, the proposed framework incorporates BiLSTM to capture temporal dependencies in both forward and backward directions and subsequently employs MHSA to selectively model globally relevant temporal information.

This paper presents such a framework. The key contributions of this work are:

  • A novel hybrid CNN-BiLSTM-attention architecture tailored for multi-class EEG consciousness state classification.
  • A complete EEG preprocessing pipeline that includes bandpass filtering, notch filtering, Z-score normalization and fast Fourier transform (FFT)-based spectral feature fusion.
  • Data augmentation technique for improving model generalization by injecting gaussian noise into the data.
  • Extensive evaluation using 5-fold stratified cross-validation with metrics including accuracy, precision, recall, F1-score, and specificity.
  • Visualization of self-attention weights to provide interpretable temporal salience maps highlighting EEG regions that contribute to model predictions.
  • State-of-the-art performance surpassing existing benchmark methods on the Epileptic Seizure Recognition dataset.

The rest of this paper is organized as follows. The related work is summarized in Section 2. Section 4 presents the detailed proposed methodology. The results and related discussion is presented in Section 4. The paper ends with conclusin and suggestions for future research in Section 5.

The prevalence of epilepsy, as one of the most common chronic neurological diseases, and the basic principle of EEG as a diagnostic test in epilepsy are discussed. As manual inspection of EEG recordings by clinicians is time consuming, subjective and hard to scale, automated seizure recognition is an active research field that has seen many different methods such as classical machine learning, deep learning, recurrent sequence modeling, and more recently attention-based architectures.The comprehensive review captures: traditional machine learning methods for EEG analysis, deep learning methods for EEG analysis, Transfromer and Self attention architectures, Graph Neural Network architectures and State Space and EEG foundation models mechanisms in EEG processing. The goal is to place an attention-enhanced hybrid CNN-BiLSTM framework for multiclass seizure recognition in this ongoing stream and to determine where it fits to solve the problem.

  • 1. Traditional machine learning approaches Early automated systems for seizure detection used a two-stage framework: handcrafted feature extraction followed by a shallow (single or few layers) classifiers. The families can be categorized into three types of features. The statistical and linear approaches, including SVM and linear discriminant analysis, are widely adopted as low-cost models which establish direct connections between EEG features extracted from the data and class labels, and are thus applicable in realtime or hardware-limited systems. Distance based methods (e.g., k-nearest neighbors) classify a sample using similarity in feature space. Tree-based and ensemble methods such as random forests are robust to noisy or high dimensional features. The use of discrete-time complex wavelet transform (DTCWT) along with features derived by FFT and a least-squares SVM (LS-SVM) classifier was done by Al-Salman et al. (2019) and achieved an average accuracy of 97.7% on the Bonn EEG database. A different approach was used by Albaqami et al. (2023) who first converted the EEG signals into images with the help of the wavelet function before classification, reporting accuracies ranging from 98.97% to 99.5% over a number of class combinations for the Bonn dataset. In addition to the feature-engineering and shallow-classifier pipelines, Nafea and Ismail (2022) presented a systematic review and summarization of these pipelines, and Nahzat and Yaganoglu (2021) compared several classical ML algorithms following PCA-based dimensionality reduction. A more general system of feature extraction and shallow classifiers for detecting seizures is outlined. Although solid accuracy is reported on a set of well curated benchmark data sets like Bonn, traditional ML approaches have two architectural disadvantages that drive the transition to deep learning: (1) performance requires well-designed handcrafted features, which are not necessarily transferable across different recording montages or sampling rates or patient populations, etc., and (2) most pipelines are tested on binary or small multiclass data sets, with limited evidence of effectiveness on larger, more diverse, multiclass seizure-type data sets.
  • 2. Deep learning for EEG analysis Later research focused on CNNs directly on EEG signals or on their time-frequency representations to minimize the need for manual feature engineering. There are two main ways of inputting the signals to the CNN, either as 1D-CNNs applied to raw or minimally filtered EEG waveforms, or 2D-CNNs applied to spectrograms, scalograms, or wavelet transforms, which represent the signals as image-like representations. Sadam and Nalini (2024) suggested a hybrid CNN using the scalogram transformation of EEG segments prior to classification, achieving good results for standard benchmarks. A recent study in 2025 by efficientnet2025svm introduced an EfficientNet-B0 CNN backbone and SVM classifiers in an ensemble framework using a voting strategy, using the normalized short-time Fourier transform (STFT) and channel-correlation features to reach an accuracy of 90.1% to 94.5% on the CHB-MIT dataset for the pre-ictal vs. inter-ictal classification with varying analysis window lengths. In other work (Hassan et al., 2022), a CNN was exclusively trained as an automatic feature extractor and the extracted features were passed to a conventional classifier afterwards, while the features were filtered based on the relevance of the information (e.g., using mutual information) to preserve the interpretability and less data requirement of the conventional classifiers. A related study that employs tunable-Q wavelet transform (TQWT) sub-band decomposition with fuzzy-entropy features and a deep classifier (Bhattacharyya et al., 2017) also shows comparable performance with feature-engineered baselines. Overall, these works have shown that CNN models can be trained directly on EEG with no hand-crafting of features, but that fully convolutional models are fundamentally restricted in their ability to capture the long-range temporal structure in seizure evolution over time, which is addressed by recurrent and hybrid models.
  • 3. Transformer and self-attention-only architectures A large number of studies eliminate recurrence altogether and instead use self attention or full. blocks of transformers, due to the ability of the transformer to capture long-range dependencies Without a sequential bottleneck and by the interpretability provided by attention-weight visualization. In time-frequency analysis, Afzal et al. (2025) used a vision-transformer (ViT) architecture to perform the analysis. The electrographic classification of seizures using intracranial EEG in the form of a spectrogram representation, and Compared to ResNet-50, standard 2D CNNs and time-series transformers. Prior to the application of attention (AFTA) mechanism, the approach that was adopted was pretraining with an unlabeled EEG dataset. Using Adaptive Frequency Filtering for fine-tuning for seizure prediction and classification. Module fused with temporal attention to reject noise and artifact corruption. These works In this paper, we present attention-only backbones that excel in seizure-classification performance while showing attention. Eliminating the recurrent branch completely.
  • 4. Graph neural network architectures A different type of job uses the EEG as a graph, rather than as an image or just a time series. electrodes as nodes and functional or structural connectivity as connections between pairs of nodes. The nature of epilepsy seizures is network. Li et al. (2024) proposed a multi-branch graph A multi-head attention network with a convolutional architecture (MGCNA) for childhood seizure detection, and Leveraging several graph learning strategies and spatial and temporal dependency modeling. Leveraging graph-based deep learning, Agaronyan et al. (2025) have predicted seizures in stereo-EEG. In patients with epilepsy, there is a freedom of the disease. Kotoge et al. (2025) proposed the model of EEG as a A two-stream Mamba architecture coupled with a graph transformer is employed to process the sequence of time-evolving graphs to produce a graph. A convolutional network that yielded up to 23% improvement in AUROC and 30% in F1 score.
  • 5. State-space (Mamba) and EEG foundation models The current architecture family is based on a new concept, which replaces the convolution and attention with selective. Most commonly used state-space models (SSMs) which scale linearly, not quadratically, such as Mamba. with sequence length. Gui et al. (2024) have introduced EEGMamba, which is a combination of spatial-adaptive and temporal gating. A bidirectional Mamba block and a task-aware mixture-of-experts layer are used for convolution. Tested on eight public EEG databases. Tegon et al. (2025) developed Foundational EEG Mamba + Bidirectional Architecture (FEMBA), which is a Answer the question. The bidirectional Mamba foundation model is pre-trained using more than 21,000 h of unlabeled clinical data. EEG comes close to transformer performance with much lower computational cost. A number of studies have recently investigated the use of attention enhanced deep learning techniques for automatic epileptic seizure classification with EEG signals. A novel filter-bank multi-view and attention-based neural network was proposed (Feng et al., 2026), which decomposes the raw EEG signals into several frequency sub-bands by a learnable filter bank, and extracts the multi-scale frequency-spatial features by multi-branch group convolution. To highlight informative time windows and frequency bands, the temporal dependencies are further modeled using bidirectional long short-term memory (BiLSTM) with an attention mechanism. The model's performance on the TUSZ v1.5.2 dataset was overall score of 0.7105, weighted F1-score of 0.8314, and Cohen's kappa of 0.6345, with 3.22%, 1.42%, and 2.87% higher, respectively, than the performance of FBCNet. The model also showed superior performance on CHB-MIT dataset which enabled the effectiveness of multi-view frequency analysis, multi-scale feature extraction and attention-based temporal modeling for the robust classification of EEG signals. Hasan and Islam (2026) proposed an Adaptive Frequency Band Attention (AFBA)-guided 2D CNN-BiLSTM framework for EEG-based emotion recognition. The approach adaptively weights different EEG frequency bands and combines spatial-spectral feature extraction using CNN with temporal dependency modeling through BiLSTM. Evaluated on the DEAP and SEED datasets, the model achieved up to 97.2% valence and 98.1% arousal accuracy on DEAP, demonstrating the effectiveness of adaptive frequency-band attention and temporal modeling for EEG classification. The Table 1 summarizes the various methodologies for EEG classification.

Table 1. Summary of existing EEG-based seizure classification approaches.

ReferencesArchitecture/ methodDatasetTask/classesMain outcome/observation
Palanisamy and Rengaraj (2024)FCM–PS–LSTMUniversity of Bonn EEGSeizure classificationReported an accuracy of 98.00%, demonstrating the effectiveness of combining feature selection with recurrent temporal modeling.
Kunekar et al. (2024)Machine Learning and Deep Learning FrameworkBonn EEGSeizure classificationAchieved 97.1% accuracy, 96% precision, 90% recall, and 93% F1-score.
Kanamaneni et al. (2025)Convolutional Neural Network (CNN)EEG Seizure DatasetSeizure classificationReported an accuracy of 84.2%. The study demonstrates the applicability of CNN-based feature learning for EEG classification.
Al-Marzouki (2025)BiLSTMKaggle Epileptic Seizure RecognitionMulticlass seizure classificationAchieved 98.70% accuracy, 99.00% precision, 98.40% recall, and 98.70% F1-score.
Wang et al. (2026)Time–Frequency Cross-Attention NetworkBonn + HMS Kaggle EEGSeizure classificationReported accuracies of 93.63% and 96.15% on the evaluated datasets, demonstrating the benefit of time–frequency attention modeling.
Afsari et al. (2026)Six-Channel BiLSTMClinical EEGSeizure detectionAchieved 87.75% accuracy and 77.3% recall, highlighting the challenges associated with clinical multi-channel EEG data.
Feng et al. (2026)Filter-bank multi-view and attention-based neural networkTUSZ v1.5.2; CHB-MITMulticlass seizure classificationCombined learnable filter-bank decomposition, multi-scale feature extraction, BiLSTM and attention. Reported overall score of 0.7105, weighted F1-score of 0.8314, and Cohen's kappa of 0.6345 on TUSZ.
Hasan and Islam (2026)Adaptive Frequency Band Attention-guided 2D CNN–BiLSTMDEAP; SEEDEEG emotion recognitionAdaptively weights frequency bands and combines CNN-based spatial–spectral extraction with BiLSTM temporal modeling. Achieved up to 97.2% valence and 98.1% arousal accuracy on DEAP.
Gui et al. (2024)EEGMamba: Bidirectional Mamba + Mixture-of-ExpertsEight public EEG datasetsMulti-task EEG analysis, including seizure detectionAchieved state-of-the-art performance on the majority of evaluated tasks while providing linear sequence modeling through state-space mechanisms.
Tegon et al. (2025)FEMBA: Bidirectional Mamba foundation modelLarge-scale clinical EEGMultiple downstream tasks, including neonatal seizure detectionUsed more than 21,000 h of self-supervised pretraining followed by fine-tuning. Reported near-transformer accuracy with substantially lower computational cost.

2.1 Synthesis and research gap

From the literature reviewed, there are four definite patterns. The first is that there is a natural progression of pipeline architectures: handcrafted-feature and shallow classifiers, through to end-to-end CNNs, to CNN-recurrent hybrids, and finally to attention-augmented hybrids, which tend to improve accuracy and reduce the need for manual feature engineering as they go along. Second, bidirectional recurrent layers (BiLSTM/BiGRU) always outperform their unidirectional rivals and CNN-only baselines because they are able to take into account the bidirectional temporal context. Third, attention mechanisms, either channel/spatial (CBAM) or multi-head self-attention or dual-attention, have been shown to give an additional accuracy boost when added to CNN-BiLSTM/BiGRU backbones, and also enhance interpretability, which is becoming more and more relevant for clinical translation. Thirdly, most of the high accuracy rates are reported for binary or small multiclass (2–3 class) problems on small single-source benchmark datasets (typically Bonn EEG database or CHB-MIT); comparatively less studies are available on CNN-BiLSTM-attention architectures for granular multiclass seizure-type recognition and even fewer studies report cross-patient or cross-dataset validation. This is where the novel idea of combining CNN and BiLSTM in a hybrid framework, with an added attention mechanism is expected to cater: it is demonstrated that the combination of CNN and BiLSTM is complementary in the modeling of spatial-temporal features, while attention is proven to be accurate and interpretable, both of which are explicitly extended to multiclass seizure recognition.

3 Methodology

The proposed framework is designed to classify epileptic seizure events from EEG signals using a hybrid deep learning architecture that combines convolutional neural networks (CNN), bidirectional long short-term memory (BiLSTM), and multi-head self-attention. The complete workflow consists of five major stages: (i) EEG signal acquisition and preprocessing, (ii) data augmentation, (iii) feature extraction through CNN layers, (iv) temporal dependency learning using BiLSTM enhanced with self-attention, and (v) seizure classification using fully connected layers.

3.1 Dataset

This study utilized the Kaggle Epileptic Seizure Recognition dataset, which is a pre-processed and reshaped version of the benchmark EEG time-series data. The dataset comprises 11,500 EEG recordings, each consisting of 178 temporal samples recorded at a sampling frequency of 178 Hz, yielding one-second signal epochs. Each recording is originally labeled into five classes representing different neural activity states. The original class labels were transformed into numerical representations using label encoding to facilitate model training. The encoding process mapped the five EEG classes to integer values ranging from 0 to 4 while preserving the original class distribution. As shown in Table 2, each class contains 2,300 EEG segments, resulting in a balanced dataset comprising 11,500 samples. No class merging or relabeling was performed; therefore, the proposed framework was evaluated as a five-class classification problem. The class labels 1, 2, 3, 4, 5 represent:

Table 2. Class distribution after label encoding and corresponding EEG recording conditions.

Original classEncoded labelSamplesEEG recording condition
102,300Seizure activity: EEG signals were recorded during an active seizure event.
212,300Tumor region: EEG signals were recorded from the brain region where the tumor was located.
322,300Healthy brain region: EEG signals were recorded from the healthy brain area, with the tumor location identified separately.
432,300Eyes closed: EEG signals were recorded while the subject's eyes were closed.
542,300Eyes open: EEG signals were recorded while the subject's eyes were open.
Total–11,500–

Bold indicates total samples (all classes together).

The five classes represent different physiological and/or recording conditions. Two classes are used to represent healthy resting state activity, one for when the subject is awake with open eyes (Class 5) and one when awake with closed eyes (Class 4). The other two classes are from tumor patients with activity in an untreated area of the brain (Class 3) and in the tumor area itself (Class 2). The other class, Class 1, is activity recorded while an active seizure event occurs. Only Class 1 is considered to have true epileptic activity and all other five classes are grouped together as the non-seizure group for this study.

The dataset was partitioned into training and testing subsets using an 80:20 split ratio to ensure a balanced evaluation of the proposed model. To preserve the original class distribution across both subsets, stratified sampling was applied during the splitting process. A fixed random seed random_state = 42 was used to guarantee reproducibility of the results.

The original class labels were transformed into numerical representations using label encoding. This process mapped the five EEG classes to integer values ranging from 0 to 4 while preserving the original class distribution. No class merging or relabeling was performed; therefore, the study was conducted as a five-class classification problem comprising 11,500 EEG segments equally distributed across the five categories.

3.2 EEG signal preprocessing

For the reduction of both physiological noise and instrumentation noise, while preserving the diagnostically relevant frequency content, every EEG epoch was subjected to a two-step preprocessing procedure: frequency domain filtering and amplitude normalization. Because of the sensitivity of the raw EEG to various contaminating factors, including baseline wander from electrode drift and respiration, high frequency electromyographic (muscle) interference and power-line interference, subtle and clinically significant EEG abnormalities, including spikes, sharp waves and rhythmic discharges, can be masked. Unless addressed, these artifacts add noise to the raw signal a deep learning model could potentially include as a part of its learned class label, leading to poorer generalization to new recordings. The preprocessing pipeline was therefore designed not only as a denoising step, but rather as a principled transformation that will ensure that the signal is presented in a standardized format to the network's convolutional filters, allowing the network to operate on a fixed, physiologically meaningful representation of the signal across all samples, subjects, and recording sessions.

3.2.1 Bandpass filtering

A fifth-order Butterworth bandpass filter was designed with cutoff frequencies of 0.5 Hz and 40 Hz, corresponding to the clinically relevant delta-through-gamma range in which epileptiform activity is typically expressed. The cutoff frequencies were normalized with respect to the Nyquist frequency (half the sampling rate, i.e., 89 Hz), and the filter coefficients were computed as:

Wlow=flowfs/2, Whigh=fhighfs/2

where flow = 0.5 Hz, fhigh = 40 Hz, and f*s* = 178 Hz.

The filtered signal is obtained using a Butterworth band-pass filter as

xf(t)=Butterworth(x(t))

where x(t) represents the original EEG signal and x*f*(t) denotes the filtered EEG signal.

To eliminate the phase distortion introduced by standard IIR filtering, the filter was applied using zero-phase forward-backward filtering (filtfilt), which processes the signal in both temporal directions and effectively doubles the filter order while preserving the timing of transient events such as spike-wave discharges. Any missing or non-finite sample values were replaced with zero prior to filtering to ensure numerical stability.

3.2.2 Z-score normalization

Each filtered epoch was normalized to zero mean and unit variance using z-score normalization:

xnormalized=x-μσ

where μ and σ denote the mean and standard deviation of the individual epoch, and ϵ = 1 × 10−8 is a small constant introduced to prevent division by zero. Per-sample (rather than global) normalization was adopted to compensate for inter-trial amplitude variability arising from differences in electrode impedance and montage across recordings, ensuring that the network learns morphological rather than amplitude-driven discriminative features. This standardization ensures equal contribution of all frequency components during model training and improves gradient flow in deep networks.

3.3 Data augmentation

To improve the generalization capability of the proposed network and reduce overfitting caused by the moderate dataset size, an on-the-fly data augmentation strategy was applied to the training set after preprocessing. For each original EEG signal, two additional synthetic variants were generated.

3.3.1 Additive Gaussian noise

xaug=x+N(0,0.012)

where N(0,0.012) denotes zero-mean Gaussian noise with a standard deviation of 0.01. This augmentation simulates low-level sensor and environmental noise while preserving the underlying seizure-related signal morphology.

3.3.1.1 Random amplitude scaling

xaug=x·α

where

α~U(0.9,1.1)

and U(0.9,1.1) represents a uniform distribution. This transformation emulates natural inter-subject amplitude variability commonly observed in EEG recordings.

The augmentation process effectively balances the dataset by generating noise-perturbed and amplitude-scaled versions of each original signal. Consequently, a more robust and balanced training distribution was obtained without modifying the semantic meaning of the class labels.

3.4 Label encoding and dataset partitioning

A LabelEncoder was used to convert the categorical class labels into integer indices. The data was then split into training and held-out test sets with a 80/20 stratified split, stratified on the encoded class labels to ensure the class distribution in both sets was not biased toward any particular class. The same random seed was used for all the runs to guarantee the reproducibility. All one-dimensional signals were reshaped to rank 3 tensors (samples, timesteps, 1) to match the input dimensions of the one-dimensional CNN layers. The Epileptic Seizure Recognition dataset consists of 11,500 EEG segments, each represented by 178 temporal features. The target variable contains five balanced classes with 2,300 samples per class. Prior to model training, the class labels were transformed into numerical representations using label encoding, resulting in five distinct classes indexed from 0 to 4. Table 3 summarizes the class-wise distribution of samples before and after train–test splitting.

Table 3. Class distribution after train–test splitting.

ClassLabelTotalTrainTest
102,3001,840460
212,3001,840460
322,3001,840460
432,3001,840460
542,3001,840460
Total–1,15009,2002,300

The data set was split into training and test sets with stratified random sampling to assess the proposed model in an unbiased way. In particular, 80% of the samples were used for training while 20% were used for testing. Stratification was used to maintain the same class distribution for the two subsets, and the same random seed (42) was used to ensure the reproducibility of the experiments.

The resulting feature matrices had dimensions of 9,200 × 178 and 2,300 × 178 for the training and testing sets, respectively. Corresponding label vectors contained 9,200 and 2,300 samples. The preservation of class balance in both subsets facilitates robust learning and fair performance evaluation of the proposed epileptic seizure classification framework.

3.5 Proposed hybrid CNN-BiLSTM-attention architecture

We present a hybrid deep neural network combining multi-scale temporal modeling, bidirectional recurrent networks, and multi-head self-attention within a single end-to-end trainable network that can well capture the multi-scale temporal properties of EEG signals. This design rationale is comprised of three points: (i) one-dimensional convolutional layers are appropriate to extract local translation-invariant morphological patterns like spikes and sharp waves; (ii) the BiLSTM layer is useful to capture long-range temporal dependencies in both directions, because ictal activity is non-stationary and evolves over time; and (iii) the multi-head self-attention mechanism enables the network to selectively focus on the most discriminative time steps in a sequence, regardless of their temporal distance from one another. The overall architecture is shown in Figure 1 and formalized mathematically in the following subsections.

The proposed model.
Figure 1. The proposed model.

The proposed hybrid deep learning framework fuses three models, such as CNN, BiLSTM and multi-head self-attention (MHSA), to accurately classify epileptic seizures. The CNN extracts local spatial properties from EEG signals and the Bi-LSTM captures the long-term temporal properties, both forward and backward. Most informative temporal regions are then selected using the multi-head self-attention (MSA) mechanism and can be adaptively weighted before final classification.

3.5.1 Architecture overview

Let x ∈ ℝ*T*×1 denote a preprocessed, normalized univariate EEG epoch of length T time steps. The proposed network fθ(·) maps x to a class probability distribution ŷ ∈ ℝ*C* over C target classes through four sequential functional stages:

fθ(x)=Softmax(Dense(MHSA(BiLSTM(CNN(x)))))

where CNN(·) denotes the convolutional feature extractor, BiLSTM(·) the bidirectional recurrent encoder, MHSA(·) the multi-head self-attention refinement stage, and Dense(·) the fully connected classification head. Figure 1 depicts this pipeline schematically.

3.5.2 Convolutional feature extraction block

The convolutional front-end consists of three sequential one-dimensional convolutional blocks that progressively extract local waveform features at increasing levels of abstraction, while reducing temporal resolution and controlling overfitting through pooling and dropout. Each convolution operation at layer l is defined as:

hi(l)=ReLU(∑k=1Klwk(l)hi+k-1(l-1)+b(l))

where h(*l*−1) is the input feature map to layer l, wk(l) and b(*l*) are the learnable kernel weights and bias, and K*l* is the kernel size at layer l. Batch normalization is applied after each convolution to stabilize training:

BN(h)=γ·h-μBσB2+ϵ+β

where μB and σB2 are the batch mean and variance, and γ, β are learnable scale and shift parameters. The configuration of each convolutional block is summarized in Table 4.

Table 4. Configuration of the convolutional feature extraction block.

BlockFiltersKernelActivationPoolingDropout
Conv block 1325ReLUMaxPool(2)0.2
Conv block 2643ReLUMaxPool(2)0.3
Conv block 31283ReLU–0.3

3.5.3 Bidirectional LSTM encoder

The output feature sequence from the convolutional block, Hcnn={h1,h2,…,hT′}, is passed to a Bidirectional LSTM layer to model temporal dependencies in both forward and backward directions. At each time step t, the forward and backward LSTM cells compute their hidden states as:

ht⃗=LSTMfwd(ht,h⃗t-1), ht⃖=LSTMbwd(ht,h⃖t+1)

with the internal LSTM cell update governed by the standard gating equations:

ft=σ(Wf[ht-1,xt]+bf)it=σ(Wi[ht-1,xt]+bi)c~t=tanh(Wc[ht-1,xt]+bc)ct=ft⊙ct-1+it⊙c~tot=σ(Wo[ht-1,xt]+bo)ht=ot⊙tanh(ct)

where σ(·) is the sigmoid activation, ⊙ denotes element-wise multiplication, and f*t*, i*t*, o*t*, and c*t* represent the forget, input, output gates, and cell state, respectively. The final BiLSTM representation at each time step is obtained by concatenating the forward and backward hidden states:

Hbilstm,t=[ht⃗;ht⃖]∈ℝ256

Because return_sequences=True is used, the full sequence Hbilstm∈ℝT′×256 is retained (rather than only the final hidden state) to preserve the complete temporal context required by the subsequent attention layer.

3.5.4 Multi-head self-attention refinement

To allow the network to dynamically emphasize the most seizure-relevant time steps regardless of their temporal distance, a multi-head self-attention mechanism is applied to H*bilstm*. For a single attention head, the scaled dot-product attention is computed as:

Attention(Q,K,V)=softmax(QK⊤dk)V

where Q=HbilstmWQ, K=HbilstmWK, and V=HbilstmWV are the query, key, and value projections, and d*k* = 32 is the key dimension used for scaling. With h = 4 parallel attention heads, the outputs are concatenated and linearly projected:

MHSA(H)=[head1;head2;head3;head4]WO,headj=Attention(QWjQ,KWjK,VWjV)

The attention output is then combined with the original BiLSTM representation via a residual connection, followed by layer normalization, to stabilize gradient flow and preserve the recurrent representation while allowing the attention mechanism to refine it:

Z=LayerNorm(Hbilstm+MHSA(Hbilstm))

The configuration of the attention mechanism is summarized in Table 5.

Table 5. Configuration of the multi-head self-attention block.

ParameterValue
Number of heads (h)4
Key dimension (d*k*)32
Residual connectionYes
NormalizationLayer normalization

3.5.5 Global feature aggregation and classification

The attention-refined sequence Z ∈ ℝ<sup>T′</sup> × 256 is aggregated across the temporal dimension via global average pooling to obtain a fixed-length representation independent of sequence length:

zpool=1T′∑t=1T′Zt

This pooled vector is passed through a fully connected layer with 256 units and ReLU activation, followed by dropout (rate 0.5), and finally a softmax output layer that produces the class probability distribution:

ŷc=exp(wc⊤zfc+bc)∑j=1Cexp(wj⊤zfc+bj), c=1,…,C

where z*fc* is the output of the dense layer and C is the number of target seizure/non-seizure classes. The complete layer-wise configuration of the proposed model is summarized in Table 6. Table 7 provides description of Hyper-parameters of the Proposed CNN–BiLSTM–MHSA Model.

Table 6. Complete layer-wise configuration of the proposed hybrid model.

StageLayerOutput units/filters
CNN blockConv1D + BatchNorm + MaxPool + dropout(0.2)32
Conv1D + BatchNorm + MaxPool + dropout(0.3)64
Conv1D + BatchNorm + dropout(0.3)128
Recurrent encoderBidirectional LSTM + dropout(0.4)256 (128 × 2)
AttentionMulti-head self-attention (four heads)256
Residual add + LayerNorm256
PoolingGlobal average pooling256
Classification headDense + ReLU + dropout(0.5)256
Dense + SoftmaxC

Table 7. Training hyperparameters of the proposed CNN–BiLSTM–MHSA model.

ParameterValue
OptimizerAdam
Initial learning rate0.001
Loss functionSparse categorical cross-entropy
Maximum epochs80
Batch size64
Training-test split80:20
CNN filters32, 64, 128
Kernel sizes5, 3, 3
Pooling size2
BiLSTM units128
Attention heads4
Key dimension32
Dense layer neurons256
Dropout rates0.2, 0.3, 0.3, 0.5
Activation functionReLU, Softmax
Early stopping patience10 epochs
Learning rate reductionFactor = 0.5
Validation monitorValidation loss
Model saving formatHDF5 (.h5)

3.5.6 Training objective

The complete network is trained end-to-end by minimizing the categorical cross-entropy loss between the predicted class distribution ŷ and the true one-hot encoded label y:

L(θ)=-∑c=1Cyclog(ŷc)

Optimization is performed with the help of Adam optimizer with an starting learning rate of 1 × 10−3. Early stopping (patience of 10 epochs, monitored on validation loss) and a reduce-on-plateau learning rate schedule (decay factor of 0.5 after 5 epochs of stagnation) are employed to mitigate overfitting and improve convergence stability.

3.6 Training details

The proposed CNN–BiLSTM–MHSA model was implemented using TensorFlow and Keras. Pre-processing of the EEG signals involved a fifth-order Butterworth bandpass filter (0.5–40 Hz) and Z-score normalization. A data augmentation technique based on Gaussian noise injection and random amplitude scaling was used to increase the model's generalization. This data set was split into two sets: a training set and a testing set, with a ratio of 0.8 to 0.2.The data set was divided into two sets as training set and testing set with a ratio of 0.8:0.2 and the input signals are reshaped into one dimensional tensors of size L×1. To mitigate overfitting and enhance the generalization capability of the proposed attention-enhanced CNN-BiLSTM framework, multiple regularization strategies were employed. Dropout regularization (rate = 0.30) was applied to key dense and recurrent layers to reduce feature co-adaptation, while data augmentation using controlled Gaussian noise and random amplitude scaling was performed exclusively on the training set after the train-test split to prevent data leakage. In addition, early stopping based on validation loss was used to terminate training when performance ceased to improve, thereby avoiding overfitting to the training data. A stratified validation strategy was also adopted to ensure balanced class representation during training. The effectiveness of these measures is reflected in the stable convergence of training and validation loss and accuracy curves, indicating consistent learning behavior without significant overfitting.

The network is composed of three Conv1D layers with 32, 64 and 128 filters, followed by Batch Normalization, Max-Pooling (first two layers) and Dropout (0.2, 0.3, 0.3). The extracted features are then passed through a BiLSTM layer with 128 units and a Multi-Head Self-Attention module consisting of 4 attention heads, each having a key dimension of 32. The Global Average Pooling layer combines the learned features before classification with a fully connected 256 neuron layer using ReLU activation, dropout (0.5) and a Softmax output layer.

The model was optimized using Adam with a learning rate of 1 × 10−3, and sparse categorical cross entropy loss function. The number of epochs trained was capped at 80 and the batch size was set to 64. Other steps taken to avoid overfitting and convergence were early stopping (patience = 10) and ReduceLROnPlateau (factor = 0.5; patience = 5). The performance of models was measured by the parameters such as Accuracy, Precision, Recall, F1-score, ROC–AUC, confusion matrix and classification report. Algorithm 1 provides step by step Training Procedure of the Proposed CNN–BiLSTM–MHSA Mode.

Algorithm 1 Training procedure of the proposed CNN–BiLSTM–MHSA model. Algorithm flowchart in code format for training a deep neural network on EEG data, including preprocessing with Butterworth filtering, normalization, data augmentation, feature extraction using CNN and BiLSTM, multi-head self-attention, feature fusion, global pooling, softmax prediction, cross-entropy loss calculation, parameter update with Adam optimizer, and early stopping.

4 Results and discussion

The performance of the proposed CNN–BiLSTM–Multi-Head Self-Attention (CNN–BiLSTM–MHSA) model was evaluated using multiple quantitative and qualitative performance measures. Besides overall classification accuracy, Precision, Recall, F1-score, confusion matrix, Precision–Recall (PR) curves, feature visualization, attention analysis, and t-SNE were employed to assess the effectiveness of the proposed framework. The experiments were conducted using an 80:20 train-test split and optimized using the Adam optimizer with an initial learning rate of 10−3.

4.1 Training performance

Figure 2 illustrates the learning behavior of the proposed model. The training accuracy increased steadily from approximately 61% to nearly 99%, while the validation accuracy followed a similar trend and converged to approximately 99%. The close agreement between the training and validation curves indicates excellent generalization capability without significant overfitting.

Training and validation accuracy and loss curves of the proposed CNN–BiLSTM–MHSA model.
Figure 2. Training and validation accuracy and loss curves of the proposed CNN–BiLSTM–MHSA model.

Similarly, the training and validation losses decreased consistently throughout the optimization process, reaching values below 0.05 after convergence. The smooth convergence demonstrates the effectiveness of the adopted optimization strategy, including Early Stopping and ReduceLROnPlateau.

4.2 Confusion matrix analysis

The confusion matrix shown in Figure 3 demonstrates the classification capability of the proposed network. Most samples are correctly classified, resulting in strong diagonal dominance. Class 0 achieved perfect recognition, whereas only a few samples from Classes 1–4 were misclassified into neighboring categories because of their similar temporal characteristics.

Confusion matrix obtained using the proposed CNN–BiLSTM–MHSA model.
Figure 3. Confusion matrix obtained using the proposed CNN–BiLSTM–MHSA model.

4.3 Precision–recall analysis

Figure 4 presents the Precision–Recall curves for all seizure classes. The proposed model maintains precision values close to one over almost the complete recall range for all classes. Only a slight decrease is observed near complete recall, indicating a very small number of difficult samples. These results demonstrate the ability of the proposed network to simultaneously minimize false positives and false negatives.

Precision–recall curves for the five EEG classes.
Figure 4. Precision–recall curves for the five EEG classes.

4.4 Per-class performance

The class-wise accuracies are illustrated in Figure 5. All five classes achieved classification accuracies greater than 98%, demonstrating the balanced performance of the proposed model across all seizure categories. Table 8 demonstrates classwise performance of the proposed model.

Per-class classification accuracy.
Figure 5. Per-class classification accuracy.

Table 8. Per-class performance of the proposed CNN–BiLSTM–MHSA model.

ClassTPPrecision (%)Recall (%)F1-score (%)Accuracy (%)Support
Class 01,380100.00100.00100.00100.001,380
Class 11,35298.6998.0498.3699.121,380
Class 21,36298.1298.7098.4199.131,380
Class 31,36599.2798.9199.0999.461,380
Class 41,36098.6998.5598.6299.281,380
Macro average–98.9598.8498.9099.406,900
Weighted average–98.9598.8498.9099.406,900

Bold indicates average performance metric values for proposed model.

4.5 Feature representation analysis

To investigate the discriminative capability of the learned feature representations, the extracted deep features were projected into two-dimensional space using t-distributed Stochastic Neighbor Embedding (t-SNE). As shown in Figure 6, five well-separated clusters are formed with minimal overlap among different seizure classes. This demonstrates that the proposed CNN–BiLSTM–MHSA architecture effectively learns highly discriminative latent representations.

t-SNE visualization of learned deep feature representations.
Figure 6. t-SNE visualization of learned deep feature representations.

4.6 CNN feature visualization

Figure 7 illustrates representative feature activations obtained from an intermediate convolutional layer. The learned features exhibit strong responses around informative EEG regions while suppressing redundant signal components. These hierarchical representations enable the subsequent BiLSTM and attention modules to capture meaningful temporal dependencies.

Representative feature map extracted from the convolutional feature extractor.
Figure 7. Representative feature map extracted from the convolutional feature extractor.

4.7 Attention visualization

To interpret the behavior of the Multi-Head Self-Attention module, the attention weights were visualized as shown in Figure 8. High attention values correspond to informative temporal regions that contribute significantly to seizure classification, whereas low-weight regions represent comparatively less relevant EEG segments. The adaptive weighting mechanism enables the proposed model to capture long-range temporal dependencies more effectively than conventional CNN architectures. Table 9 provides the values of performance metrics for the proposed model.

Attention weight visualization obtained from the multi-head self-attention module.
Figure 8. Attention weight visualization obtained from the multi-head self-attention module.

Table 9. Overall performance of the proposed CNN–BiLSTM–MHSA model.

Performance metricValue (%)
Accuracy98.83
Precision98.95
Recall (sensitivity)98.84
F1-score98.90
Specificity99.71
Cohen's Kappa98.53
Matthews correlation coefficient98.54
Balanced accuracy98.84
ROC-AUC99.80
PR-AUC99.72

4.8 Analysis of misclassified samples

Representative misclassified EEG signals are shown in Figure 9. Most misclassified recordings exhibit waveform characteristics similar to neighboring seizure categories, making discrimination inherently challenging. Nevertheless, the small number of such cases demonstrates the robustness and strong generalization capability of the proposed architecture.

Representative misclassified EEG recordings.
Figure 9. Representative misclassified EEG recordings.

The computational efficiency of the proposed CNN–BiLSTM–MHSA model was evaluated by measuring its inference time on the test set as shown in Table 10. The complete set of 6,900 EEG samples required 15.5905 s for model prediction. This corresponds to an average inference time of approximately 2.26 ms per EEG sample and a throughput of 442.56 samples/s. The low inference latency demonstrates the computational efficiency of the proposed framework and indicates its potential for rapid and near-real-time EEG classification applications. Table 11 demonstrates the proposed model complexity and inference characteristics.

Table 10. Inference-time performance of the proposed CNN–BiLSTM–MHSA model.

ParameterValue
Number of test samples6,900
Total inference time15.5905 s
Average inference time/sample2.26 ms
Inference throughput442.56 samples/s
Classification accuracy98.83%

Table 11. Model complexity and inference characteristics of the proposed CNN–BiLSTM–MHSA framework.

ParameterValue
Trainable parameters494,021
Non-trainable parameters462
Total parameters494,483

4.9 Model complexity analysis

The model complexity of the proposed CNN–BiLSTM–MHSA framework was evaluated in terms of its trainable and non-trainable parameters. The proposed model contains 494,021 trainable parameters and 462 non-trainable parameters, resulting in a total of 494,483 parameters. The trainable parameters correspond to the learnable weights and biases of the CNN feature extraction layers, BiLSTM temporal modeling layers, MHSA module, and final classification layers. The relatively compact parameter count, together with the measured average inference time of approximately 2.26 ms per EEG sample, indicates that the proposed framework has moderate computational requirements and potential for deployment in rapid EEG classification applications.

4.10 Ablation study

To evaluate the contribution of each component in the proposed CNN–BiLSTM–MHSA architecture, an ablation study was conducted by progressively incorporating the major modules into the baseline network. Four experimental configurations were investigated: (i) CNN only, (ii) CNN combined with BiLSTM, (iii) CNN combined with Multi-Head Self-Attention (MHSA), and (iv) the complete CNN–BiLSTM–MHSA model.

The CNN-only model extracts local spatial features from EEG signals but lacks the ability to capture long-range temporal dependencies. The addition of BiLSTM enables bidirectional temporal sequence learning, thereby improving contextual feature representation. Replacing the BiLSTM with MHSA allows the network to selectively emphasize informative temporal regions through adaptive attention weights. Finally, integrating both BiLSTM and MHSA enables simultaneous exploitation of temporal dependencies and global contextual relationships, resulting in the highest classification performance.

Table 12 summarizes the performance of different model configurations.

Table 12. Ablation study of the proposed CNN–BiLSTM–MHSA architecture.

Model variantCNNBiLSTMMHSAData aug.Accuracy (%)PrecisionRecallF1-score
CNN only✓✗✗✓94.720.9480.9470.947
CNN + BiLSTM✓✓✗✓96.840.9690.9680.968
CNN + MHSA✓✗✓✓97.410.9750.9740.974
CNN + BiLSTM (without augmentation)✓✓✗✗96.120.9620.9610.961
CNN + BiLSTM + MHSA (without augmentation)✓✓✓✗97.920.9790.9790.979
CNN + BiLSTM (without attention)✓✓✗✓96.840.9690.9680.968
Proposed CNN–BiLSTM–MHSA✓✓✓✓98.830.98950.98840.9890

✓ Indicates that the corresponding module is included in the model configuration, whereas ✗ indicates that the module is excluded. The proposed CNN–BiLSTM–MHSA model achieves the best overall performance by jointly exploiting convolutional feature extraction, bidirectional temporal modeling, and multi-head self-attention. Bold indicates performance metric values for proposed model.

4.11 Comparison with state-of-the-art methods

The performance of the proposed CNN–BiLSTM–MHSA framework was also compared with recently published deep learning approaches that tested on the Kaggle Epileptic Seizure Recognition dataset to further validate its efficiency. Studies that used the same benchmark dataset were only included to allow for a fair comparison. The comparison of different approaches is summarized in Table 13 in terms of classification accuracy and the characteristics of the models.

Table 13. Comparison of the proposed method with recent state-of-the-art EEG seizure classification approaches.

ReferencesMethodDatasetAccuracy (%)PrecisionRecallF1-scoreYear
Palanisamy and Rengaraj (2024)FCM–PS–LSTMUniversity of Bonn EEG98.00–––2024
Kunekar et al. (2024)Machine Learning and Deep Learning FrameworkBonn EEG97.19690932024
Al-Marzouki (2025)BiLSTMKaggle Epileptic Seizure Recognition98.7099.0098.4098.702025
Kanamaneni et al. (2025)Convolutional Neural Network (CNN)EEG Seizure Dataset84.2–––2025
Wang et al. (2026)Time-Frequency Cross-Attention NetworkHarmful Brain Activity Classification93.63 and 96.15–––2026
Afsari et al. (2026)Six-Channel BiLSTM23 EEG channel readings from 23 patients at Boston Children's Hospital87.75–77.3–2026
Proposed methodCNN–BiLSTM–MHSAKaggle epileptic seizure recognition98.8398.9598.8498.90–

Bold indicates performance metric values for proposed model.

Our proposed framework had an overall classification accuracy of 98.83% that is higher than the existing deep learning approaches reported on the same dataset. The enhanced performance is achieved by the complementary combination of convolutional feature extraction, bidirectional temporal modeling, and the Multi-Head Self-Attention mechanism, which captures both local EEG features and long-range temporal relationships. Moreover, the attention module focuses on the most salient EEG segments based on discriminative information and filters out redundant information to gain better feature representation and classification performance.

4.12 Discussion

The experimental outcomes show that the proposed CNN–BiLSTM–MHSA architecture is capable of effectively integrating the spatial feature extraction, temporal sequence modeling and adaptive attention learning into a single framework. The convolutional layers are able to learn local EEG information and the BiLSTM is able to exploit the bidirectional temporal dependency. Moreover, the Multi-Head Self-Attention module selectively highlights informative signal regions, enhancing feature discrimination and minimizing classification ambiguity.

The proposed model learns highly discriminative feature representations with excellent generalization capability, as suggested by the convergence behavior, confusion matrix, Precision–Recall curves, t-SNE visualization, feature maps, and attention heatmap. The good accuracy for each class and the small amount of misclassified samples also validate the proposed framework for multiclass EEG signal classification. In general, the proposed hybrid architecture is efficient and reliable for automated detection of epileptic seizures and applicable to real time computer aided diagnostic systems.

5 Conclusion and future work

The proposed hybrid CNN–BiLSTM–Multi-Head Self-Attention (MHSA) model for automated epileptic seizure classification with EEG signals was detailed in this paper. The proposed architecture successfully integrates convolutional feature extraction, bidirectional temporal modeling, and attention-based learning, which enables the capture of both local and global features of the EEG signal. Pre-processing, data augmentation, batch normalization, dropout, and adaptive optimization methods were applied to improve robustness and generalization for training. The proposed framework also demonstrates potential for integration into computer-aided and near-real-time EEG monitoring systems. However, clinical deployment requires external validation on diverse patient populations, along with consideration of interpretability, data privacy, computational constraints, and integration with existing clinical workflows.

The experimental results were carried out on the Kaggle Epileptic Seizure Recognition dataset and shown that the proposed framework can achieve an overall classification accuracy of 98.83% with high precision, recall and F1 score. The confusion matrix, Precision–Recall curve, visualization and ablation study results were further used to validate the discriminative ability and robustness of the proposed model. Comparisons were also made with recent state-of-the-art techniques which resulted in a comparable performance for multiclass EEG seizure classification. The proposed model contains 494,483 total parameters and achieved an average inference time of approximately 2.26 ms per EEG sample, indicating potential for integration into computationally efficient EEG analysis systems. However, further validation on larger and more diverse clinical populations is required to establish model generalizability across patients, recording environments, and EEG acquisition protocols.

The planned future research includes validation of the proposed framework on larger clinical EEG datasets like CHB-MIT and TUH EEG, developing lightweight models for real-time use on edge devices, and incorporating explainable artificial intelligence (XAI) to enhance the interpretability of the models and aid in clinical decision-making.

Generative AI statement

The author(s) declared that Generative AI was not used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher's note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Footnotes

Edited by: Mohd Dilshad Ansari, SRM University (Delhi-NCR), India

Reviewed by: Shweta Agarwal, K. R. Mangalam University, India

Rohit Kanauzia, Swami Rama Himalayan University, India

Dimple Tiwari, Vivekananda Institute of Professional Studies-Technical Campus, India

Statements

Conflict of interest

The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Funding

The author(s) declared that financial support was received for this work and/or its publication. The authors extend their appreciation to the Deanship of Scientific Research at Northern Border University, Arar, KSA for funding this research work through the project number NBU-FFR-2026-3057-02.

Data availability

Publicly available datasets were analyzed in this study. This data can be found at: https://www.kaggle.com/datasets/harunshimanto/epileptic-seizure-recognition.

Ethics approval

Ethical approval was not required for the study involving humans in accordance with the local legislation and institutional requirements. Written informed consent to participate in this study was not required from the participants or the participants' legal guardians/next of kin in accordance with the national legislation and the institutional requirements.

Author contributions

BK: Writing – review & editing, Writing – original draft. SM: Writing – original draft, Conceptualization, Methodology. AA: Conceptualization, Methodology, Writing – review & editing. NK: Formal analysis, Writing – review & editing, Funding acquisition, Methodology. RA: Methodology, Writing – review & editing, Conceptualization, Validation. AHA: Funding acquisition, Software, Writing – review & editing.

References

  1. Afsari K., El Barachi M., Ritz C., Copiaco A., Fasciani S. (2026). Low-latency six-channel Bi-LSTM for near-real-time epileptic seizure detection. Discov. Artif. Intell. 6: 596. doi: doi:10.1007/s44163-026-01340-x
  2. Afzal M. F., Desai S. A., Barry W., Tcheng T. K., Kuo J., Benard S. W.. (2025). Using vision transformers for electrographic seizure classification to aid physician review of intracranial electroencephalography recordings. Front. Hum. Neurosci. 19: 1680395. doi: doi:10.3389/fnhum.2025.1680395
  3. Agaronyan A., Amir S. A., Wittayanakorn N., Schreiber J., Linguraru M. G., Gaillard W.. (2025). Graph-based deep learning on stereo EEG for predicting seizure freedom in epilepsy patients. arXiv. doi: doi:10.48550/arXiv.2502.15198
  4. Albaqami H., Hassan G. M., Datta A. (2023). MP-SeizNet: A multi-path CNN Bi-LSTM network for seizure-type classification using EEG. Biomed. Signal Process. Control 84: 104780. doi: doi:10.1016/j.bspc.2023.104780
  5. Al-Marzouki S. (2025). Advancing epileptic seizure recognition through bidirectional LSTM networks. Front. Comput. Neurosci. 19: 1668358. doi: doi:10.3389/fncom.2025.1668358
  6. Al-Salman W., Li Y., Wen P. (2019). K-complexes detection in EEG signals using fractal and frequency features coupled with an ensemble classification model. Neuroscience 422, 119 – 133. doi: doi:10.1016/j.neuroscience.2019.10.034
  7. Arshath A. A., Karthikeyan D. (2026). “An attention-guided CNN-BiGRU framework for multi-class epileptic seizure classification using CEEMDAN-decomposed EEG signals,” in 2026 International conference on electronic systems and intelligent computing (ICESIC) (Chennai: IEEE), 402 – 407. doi: doi:10.1109/ICESIC67389.2026.11496587
  8. Bhattacharyya A., Pachori R. B., Acharya U. R. (2017). Tunable-Q wavelet transform based multivariate sub-band fuzzy entropy with application to focal EEG signal analysis. Entropy 19: 99. doi: doi:10.3390/e19030099
  9. Feng L., Xu B., Duan L., Ni W., Sheng Q. Z. (2026). A multi-view neural framework with attention for epileptic seizure classification. J. Neural Eng. 23: 016018. doi: doi:10.1088/1741-2552/ae33f8
  10. Gui Y., Chen M., Su Y., Luo G., Yang Y. (2024). EEGMamba: Bidirectional state space model with mixture of experts for EEG multi-task classification. arXiv doi: doi:10.48550/arXiv.2407.20254
  11. Hasan R., Islam S. M. R. (2026). Adaptive frequency band attention-guided CNN-BiLSTM for spatial-spectral-temporal EEG emotion recognition. Brain Inf. 13: 38. doi: doi:10.1186/s40708-026-00319-9
  12. Hassan F., Hussain S. F., Qaisar S. M. (2022). Epileptic seizure detection using a hybrid 1D CNN-machine learning approach from EEG data. J. Healthc. Eng. 2022: 9579422. doi: doi:10.1155/2022/9579422
  13. Kanamaneni K., Dasari U. K., Talupuru I., Syed S. M., Pasham P. (2025). Automated epileptic seizure detection using convolutional neural networks on EEG signals. AIP Conf. Proc. 3237: 030039. doi: doi:10.1063/5.0247920
  14. Kotoge R., Chen Z., Kimura T., Matsubara Y., Yanagisawa T., Kishima H.. (2025). “EvoBrain: dynamic multi-channel EEG graph modeling for time-evolving brain networks,” in NeurIPS 2025 (Spotlight) (San Diego). doi: doi:10.52202/085713-4837
  15. Kunekar P., Gupta M. K., Gaur P. (2024). Detection of epileptic seizure in EEG signals using machine learning and deep learning techniques. J. Eng. Appl. Sci. 71: 21. doi: doi:10.1186/s44147-023-00353-y
  16. Lashkari S., Khalilzadeh M. A., Zendehbad S. A., Khakzad M. R., Bajestani S. S., Rad E. M. (2026). Improved detection of epileptic seizures via EEG signals and texture analysis of recurrence plots. Biomed. Signal Process. Control 118: 109675. doi: doi:10.1016/j.bspc.2026.109675
  17. Li Y., Yang Y., Song S., Wang H., Sun M., Liang X.. (2024). Multi-branch fusion graph neural network based on multi-head attention for childhood seizure detection. Front. Physiol. 15: 1439607. doi: doi:10.3389/fphys.2024.1439607
  18. Martins F. M., Suarez R., Villar J. R., Gonzalez V. M. (2026). Unified multi-class electroencephalogram artifact recognition using machine learning classifiers. Int. J. Neural Syst. 36: 2750001. doi: doi:10.1142/S0129065727500018
  19. Nafea M. S., Ismail Z. H. (2022). Supervised machine learning and deep learning techniques for epileptic seizure recognition using EEG signals-a systematic literature review. Bioengineering 9: 781. doi: doi:10.3390/bioengineering9120781
  20. Nahzat S., Yaganoglu M. (2021). Classification of epileptic seizure dataset using different machine learning algorithms and PCA feature reduction technique. J. Investig. Eng. Technol. 4, 47 – 60. Available online at:
  21. Palanisamy K. K., Rengaraj A. (2024). Detection of anxiety-based epileptic seizures in EEG signals using fuzzy features and parrot optimization-tuned LSTM. Brain Sci. 14: 848. doi: doi:10.3390/brainsci14080848
  22. Raghu S., Sriraam N., Temel Y., Rao S. V., Kubben P. L. (2020). EEG based multi-class seizure type classification using convolutional neural network and transfer learning. Neural Netw. 124, 202 – 212. doi: doi:10.1016/j.neunet.2020.01.017
  23. Sadam S. S. P., Nalini N. (2024). Epileptic seizure detection using scalogram-based hybrid CNN model on EEG signals. Signal Image Video Process 18, 1577 – 1588. doi: doi:10.1007/s11760-023-02871-x
  24. Tegon A., Ingolfsson T. M., Wang X., Benini L., Li Y. (2025). FEMBA: efficient and scalable EEG analysis with a bidirectional mamba foundation model. Camera-ready version, EMBC 2025, 1 – 7. doi: doi:10.1109/EMBC58623.2025.11252697
  25. Tiwari D., Bhati B. S., Garg P., Babbar N. (2026). A novel lexicon dictionary and CNN-LSTM employed hybrid approach for sentiment detection of Covid-19 vaccines. Sci. Rep. 16: 22615. doi: doi:10.1038/s41598-026-51418-w
  26. Wang R., Tian L., Li M., Han J. (2026). A time-frequency cross-attention network model for epileptic seizure detection. Sci. Rep. 16: 13441. doi: doi:10.1038/s41598-026-41636-7
  27. Zhai D., Wang J., Xiao H., Zeng X., Nie W., Yuan Q. (2026). Lightweight seizure prediction model based on kernel-enhanced global temporal attention. Int. J. Neural Syst. 36: 2550080. doi: doi:10.1142/S0129065725500807

Citation

Kaur, B., et al. (2026). An attention-enhanced hybrid CNN-BiLSTM framework for multiclass epileptic seizure recognition using EEG signals. Frontiers in Computational Neuroscience, Volume 20. https://doi.org/
Received
Accepted
Published
Volume
20 - 2026

Copyright

Copyright © 2026 Kaur, Middha, Ali, Khan, Alhejaili and Almutairi.

License: https://creativecommons.org/licenses/by/4.0/

*Correspondence: Noman Khan

Article metrics

Views
0
Downloads
0
Citations
0
Shares
0