Research Article

SET Net A Hybrid Deep Learning Framework For EEG Based Attention Relaxation Classification In Brain Computer Interface Applications

DOI:

10.3791/70700

May 29th, 2026

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This paper presents the squeeze-and-excitation transformer network (SET-Net) which is a hybrid CNN-Transformer network that recognizes attention and relaxation states using spectrogram features to identify EEG-based attention and relaxation states with 93.7% accuracy and high generalization to be used in Brain Computer Interface (BCI) applications.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Brain Computer Interface (BCI) technology is used as a tool to provide a direct communication channel between the human brain and the external environment. This has applications in assistive and interactive systems. The non-invasive acquisition of neural activity using Electroencephalography (EEG) is standard with BCI systems. However, it is difficult to effectively classify cognitive states, including attention and relaxation, because the EEG signal is non-stationary and noisy. To overcome these shortcomings, this study proposes a new hybrid deep learning architecture namely, squeeze-and-excitation (SE) transformer network (SET-Net). In this method, EEG signals are preprocessed and divided into temporal windows to analyze the significant spectrogram representations. The proposed model achieves a classification accuracy of 93.7%, with F1-score of 0.93 and ROC-AUC of 0.98. This demonstrates the effectiveness of the hybrid deep learning model with enhanced discrimination of EEG-based attention-relaxation state. This offers a scalable system for real-time BCI applications as assistive technology in human-computer interaction.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Brain–Computer Interfaces (BCIs) have become a disruptive technology that allows the human brain and external devices to communicate directly without using traditional neuromuscular connections. Electroencephalography (EEG) is the most common and widely used technique owing to non-invasive nature, portability, and cost-effectiveness1. EEG-based BCIs have been used in healthcare as well as in neurorehabilitation, gaming, and assistive technologies for persons with neurological disabilities by examining brain activity2. One of the most significant applications is the identification of cognitive states, including attention and relaxation, which can be used to create adaptive human-computer interfaces and digital accessibility3.A low signal-to-noise ratio, large inter-subject variability, and complicated temporal dynamics between attention and relaxation states which are interpreted using EEG; therefore, classifying attention and relaxation states using EEG is difficult4. Classical machine learning models, including support vector machine (SVM) and random forest, have shown moderate performance; however, they are typically based on feature engineering because they do not fully utilize the spatial–spectral–temporal complexity of EEG5. Recent developments in deep learning, particularly convolutional neural network (CNN) and transformer, have presented new opportunities for automated feature extraction and strong classification of EEG signals6.

EEG-based BCI systems have been extensively studied for a long period as a tool in cognitive state monitoring, neurorehabilitation, and interactive systems. The definition of mental condition is one of the most crucial challenges for example, relaxation and attention states. In response to this, scientists have demonstrated a variety of solutions, such as standard feature engineering and advanced deep learning models. Classical machine learning approaches primarily rely on manually engineered features in time, frequency, or time–frequency space. Research on hybrid deep learning algorithms as part of the SET-Net system of EEG-based attention–relaxation classification has been found to be an important scientific direction, as it could potentially enhance BCI systems that can be used in real-world settings7,8. Deep learning models, including convolutional neural networks (CNNs), recurrent neural networks (RNNs), and transformers, have achieved significant progress in EEG signal decoding in the past decade9,10. These developments have led to improved and more efficient decoding of cognitive states, which are desirable for cognitive states for neurorehabilitation and assistive technologies11,12. The growing popularity of BCI systems emphasizes the applied significance of improving the accuracy of classification, and recent results have shown that the classification can be more than 85% in motor imagery and attention activities13,14. Nevertheless, challenges to achieve strong real-time classifications within diverse and noisy settings still exist despite such developments15,16. The key problem addressed in this study is the precision and external validity of EEG-based models of attention–relaxation classification, particularly models that consist of hybrid deep learning in the SET-Net architecture17,18, are limited. The existing methods are usually associated with issues of inter-subject variability, low signal noise, and poor exploitation of spatiotemporal properties19,20,21. There are methods oriented towards convolutional feature extraction, and others are oriented towards attention or transformer architecture, leading to various opinions about the best model design22,23,24. In addition, EEG models are not easy to train and justify because of the unavailability of large annotated datasets25,26. This lack of knowledge restricts the use of BCIs in real-life conditions, which is most important to be flexible and precise 27,28. This is theoretically established on a mixture of spatial, temporal, and attention-based feature extraction using hybrid deep learning models29,30,31. This combination is seen in the SET-Net framework, which is attained through convolutional layers to extract local features and self-attention mechanisms to learn global dependencies32. This synergy enhances the representation of EEG signals and can be applied to better classification of the states of relaxation and attention. The theory is initiated on the reality that variability of EEG signals and noise can be eliminated using the strength of multiscale spatiotemporal characteristics and domain adaptation techniques33. The systematic review is focused on critically reviewing the theoretical progress of the accuracy and practical application of hybrid deep learning methods of the SET-Net architecture of EEG-based attention–relaxation classification34. The review will be utilized to guide the creation of a better, more interpretive, and generalizable BCI system in future experiments through the synthesis of the most recent developments and identification of the strengths and limitations of the methods. Such gaps will assist in the future development of real-world applications of BCI that will enhance the user and reliability of the system. The review applied a broad literature review approach, where peer-reviewed articles were exercised depending on hybrid deep learning models in EEG attention–relaxation classification34. The inclusion criteria focus on recent trends in convolutional, recurrent, and attention-based architectures in the framework of SET-Net or similar systems35. Analytical models assess model designs, feature selection algorithms, classification accuracy, and workability in a real-world setting. The findings are organized to explain theory building, practice, and future research opportunities.

Despite recent advances, existing methods fail to simultaneously capture spatial, spectral, and long-range temporal dependencies in single-channel EEG signals, resulting in suboptimal performance in attention–relaxation classification. In addition, existing methods are based on manually added characteristics or only consider a few features of EEG signals; thus, they cannot be generalized across participants and real-time conditions. Thus, there is a need for a unified framework that can sufficiently model multi-dimensional EEG features and is strong and researchable in real time.

To overcome these disadvantages, this study proposes research paper suggests a hybrid deep learning model, which is labeled the Squeeze-and-Excitation Transformer Network (SET-Net). In particular, the CNN module learns local spatial-spectral patterns with EEG spectrograms and overcomes the constraints of handcrafted feature extraction. The SE block improves feature representation by adapting channel-wise importance and increasing noise and variability robustness. Transformer encoder models long-range temporal dependencies that are not limited to CNN-only models. In addition, time-frequency analysis can be performed effectively using spectrogram-based representation, which enhances the learning of discriminative features. To guarantee stable performance, balanced training and leakage-free validation were embraced, which improved the generalization of the performance across subjects.

Moreover, the suggested structure is confirmed in a real-time application, in which the categorized cognitive states are transformed to control instructions of interactive systems. This shows that the model is practically applicable in assistive technologies and digital accessibility and could potentially be used in the practical implementation of BCI.

The main achievement of this study is the design of a new SET-Net hybrid architecture that incorporates convolutional neural networks, squeeze-and-excitation attention, and transformer encoders to better model EEG signals. Moreover, a spectrogram-based representation was used to successfully represent the time-frequency properties of the EEG signals. The suggested framework allows for a strong classification of attention and relaxation cognitive states. Moreover, the model was shown to have practical applicability in a real-time brain-to-computer interface application.

This paper is organized into sections wherein a review of studies that categorize the attention and relaxation classes of brain activity as applied to BCI systems This paper is structured to first present the research gaps and challenges associated with the development of BCI systems, and subsequently presents the data acquisition process and methodology comprising EEG signal recording, preprocessing, and feature representation. It discusses the importance of attention and relaxation activities, as well as the process of deriving meaningful features from EEG data. The findings are then presented and assessed using quantitative and comparative analyses, as well as the application's actual performance. The last part discusses the findings, limitations of the study, and future work directions.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The study was conducted in accordance with the Declaration of Helsinki and approved by the Institutional Ethics Committee of SR University, Warangal, Telangana, India (Approval No. 007/2026). Informed consent was obtained in writing from all participants before data collection.

Participant Selection

EEG data were collected from 11 healthy participants (age range: 25–45 years; mean age: 28 years) with no history of neurological or psychiatric disorders. In this study, a total of 1175 EEG segments were considered, of which 527 belong to the relaxation class and 648 belong to the attention class. Participants whose EEG recordings exhibited excessive motion artifacts or poor signal quality were excluded.

EEG Acquisition Setup

The general layout of the suggested EEG-based brain-computer interface system is depicted in Figure 1, which shows the entire pipeline of signal acquisition, classification, and real-time use. The EEG data were recorded using a small biopotential acquisition module linked to a microcontroller-based system. The gel electrodes were placed based on the International 10–20 system namely, the prefrontal points of Fp1 and Fp2, with reference and ground electrodes placed at the ear lobes, as indicated in Figure 2. The signals were digitized at a rate of 128 Hz and sent to a computer using a self-written Python acquisition script. Adequate skin pre-treatment and conductive gel were used to reduce electrode impedance and enhance signal quality.

Experimental procedure

EEG recordings were performed under two cognitive conditions, relaxation and attention, following a standardized protocol. In the relaxation condition, the participant was seated in a comfortable, low-noise environment and instructed to remain still with minimal movement. Calming instrumental audio was played through earphones, and EEG acquisition was initiated using the command python collect.py. EEG signals were recorded for 5 min per session and repeated for four sessions. In the attention condition, the participant was instructed to perform attention-demanding tasks such as interactive games while maintaining the same acquisition setup as in the relaxation condition. EEG signals were recorded for 5 min per session and repeated for four sessions. Each participant took part for a total of 40 min, consisting of 20 min of relaxation and 20 min of attention tasks, enabling a reliable comparison of cognitive states. 

The processed dataset was organized into labeled segments as follows: Relaxation (0); Attention (1). Each segment had a duration of 4 s with 50% overlap and was represented as a spectrogram using a short-time Fourier transform. 

Signal Processing, Feature Representation, and Model Implementation

The obtained EEG signals were pre-processed to eliminate noise and artifacts. A 50 Hz notch filter was used to remove powerline interference, and a 4th -order Butterworth band-pass filter in the signal between 0.5 and 30 Hz was used to select the relevant EEG frequency bands. The Amplitude thresholding and visual inspection were used to identify artifact-contaminated segments, and approximately 8–12% of the data were deleted. Gaussian noise addition, time masking, and frequency masking are data augmentation methods used to improve model robustness. EEG signals were filtered and then divided into 4-second windows separated by 50 percent.

The individual EEG segments were converted to a time-frequency representation (Short-Time Fourier Transform), as shown in Equation (1), to allow the extraction of temporal and spectral characteristics.

Fourier transform equation, Σx[n]w[n-t]e^(-j2πfn), mathematical formula.    (1)

The resulting spectrograms were normalized and resized to fixed dimensions to serve as inputs to the classification model. To prevent overlap-induced data leakage, the dataset was divided into training (70%), validation (10%), and testing (20%) subsets prior to segmentation, as illustrated in Figure 3. In addition, leave-one-subject-out (LOSO) cross-validation was performed to evaluate cross-subject generalization, where data from one subject were used for testing, whereas the remaining data were used for training.

The proposed SET-Net architecture, as shown in Figure 4, was designed to capture multi-dimensional EEG features. The model integrates a convolutional neural network (CNN) backbone to extract spatial–spectral representations, followed by a squeeze-and-excitation (SE) block that adaptively recalibrates the channel-wise feature importance, as described in Equation (2). The CNN backbone consists of two convolutional layers with a kernel size of 3 × 3, followed by batch normalization and exponential linear unit (ELU) activation

Neural network formula, diagram, activation function σ, data aggregation Σx(i,j).    (2)

The internal structure of the SE block is shown in Figure 5. To capture long-range temporal dependencies, a transformer encoder was incorporated, the attention mechanism of which is defined in Equation (3) and illustrated in Figure 6.

Attention mechanism formula in neural networks: softmax(QK^T/√dk)V, key in AI models.    (3)

An adaptive average pooling layer was used to reduce the feature maps to a fixed size of 16 × 16. The reduction ratio of the SE block is 8, which is used to recalibrate the channel-wise feature responses. The transformer encoder consisted of four layers with four attention heads, a feed-forward dimension size of 256, and a model embedding size of 128.

The final classification was performed using fully connected layers with dropout regularization and a softmax activation function to distinguish between the attention and relaxation states. The detailed layer-wise architecture of the proposed model is presented in Table 1.

The model was trained using the AdamW optimizer with an initial learning rate of 0.001 and weight decay of 1×10⁻4. A cosine annealing scheduler was used to enhance convergence, and 50 epochs were trained using a batch size of 32. Class imbalance was overcome using a weighted cross-entropy loss function, as described in Equation (4).

Loss function formula; Σwi yi log(ŷi); equation; machine learning optimization.     (4)

Table 2 summarizes the training configuration, and Table 3 presents the hyperparameter search of the proposed SET-Net, which was used in the EEG-based attention-relaxation classification. The selected parameters provide stability of the training, enhanced generalization, and tolerance to changes in EEG signals. The chosen parameters provide stability to the training process, enhance generalization, and resist alterations of the EEG signal. Accuracy, precision, recall, F1-score, and ROC-AUC were used to measure the model performance. All pipelines involving preprocessing, model training, and evaluation were written in Python using the PyTorch framework to ensure reproducibility. Table 4 provides a detailed description of troubleshooting to guide and solve problems associated with EEG acquisition, preprocessing, model training, and real-time use. Table 5 provides an overview of the materials of the EEG device to enable an easy framework for conducting experiments and the experimental setup. Python 3.8 with the PyTorch deep learning framework was used to implement the proposed SET-Net framework. Standard scientific computing libraries were used for signal preprocessing and feature extraction using NumPy, SciPy, and Matplotlib. Every experimental procedure was performed on a system with an Intel i7 processor and 16 GB RAM to hasten the training of the models.

DATA AVAILABILITY:

The anonymized EEG dataset generated and analyzed during this study is publicly available in the Zenodo repository under the following accession link: https://zenodo.org/records/19627795.

All data have been de-identified to ensure participant confidentiality in accordance with institutional ethical guidelines approved by the Institutional Ethics Committee of SR University (Approval No. 007/2026).

The processed information, model settings, and implementation specifics needed to recreate the results are presented in the manuscript, and the source code is publicly available at: https://github.com/Ravichanderj/SET-Net-EEG-BCI.

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Spectrogram-Based Feature Representation

The main goal of this study was to classify the states of attention and relaxation properly with the help of EEG signals. The conversion of raw EEG signals into spectrograms has made it possible to extract discriminative features effectively. The spectrograms indicate an augmentation of alpha band activity (8–13 Hz) during relaxation and an augmentation of beta activity (14–25 Hz) during attention. This distinct split in frequency-domai...

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The current research suggests a hybrid deep learning model, SET-Net, for EEG-based attention-relaxation classification. To learn the spatial, spectral, and temporal features of EEG signals, the architecture combines convolutional neural networks, squeeze-and-excitation attention, and transformer encoders, as shown in Figure 5. The findings indicate that the proposed method can meet the study objective. The accuracy, F1-score, and ROC-AUC values (Table 6) are high, proving th...

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors declare that they have no known competing financial interests or personal relationships that could influence the work reported in this study.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors are thankful to SR University, Warangal, Telangana State, India, for providing the necessary laboratory setup and ethical approval to conduct this study.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
Computer / LaptopGenericAny standard system≥8 GB RAM recommended
Data acquisition scriptCustomcollect.pyPython-based acquisition script
Disposable gel electrodesGenericPre-gelled Ag/AgCl electrodesSingle-use, adhesive
EEG acquisition moduleUpside Down LabsBioAmp EXG PillAnalog front-end for biopotential signals
Electrode gel (if reusable electrodes used)GenericConductive gelImproves signal conductivity
Interactive application (game)GenericAny simple game (e.g., racing)Keyboard-controlled interface
Jumper wiresGenericMale–Female connectorsStandard breadboard wires
Matplotlib / SeabornOpen-sourceLatest versionsVisualization libraries
Microcontroller boardArduinoUno / Maker Uno10-bit ADC, USB interface
Python programming environmentPython Software FoundationPython ≥3.8Open-source programming language
PyTorch libraryMeta AIVersion ≥1.12Deep learning framework
Scikit-learnOpen-sourceLatest stable versionML utilities
Signal processing librariesSciPyLatest versionFiltering, STFT
USB cableGenericUSB Type-A to BData transfer cable

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Brain Computer InterfaceEEG ClassificationAttention RelaxationDeep LearningHybrid Neural NetworkSET NetSqueeze Excitation NetworkTransformer NetworkSpectrogram AnalysisHuman Computer Interaction
Video Coming Soon

Related Articles