A Brain-Computer Interface Four-class Classification Algorithm Integrating a Custom Spiking Neural Network with Attention Mechanisms - Jia, Ying-Jie; Shi, Tian-Wei; Ren, Ling; Cui, Wen-Hua (IAENG international journal of computer science, 2025)
This paper addresses the challenges of feature extraction and classification accuracy in brain-computer interface (BCI) systems based on motor imagery tasks. We propose the SAMPN-Network model, which integrates a custom spiking neural network with a soft attention mechanism (SoftAttentionLayer), alongside the Simplicityformer classifier that incorporates a multi-head attention mechanism (MHA). The resulting classification algorithm, named Custom Spiking Neural Network Layer with Soft Attention Mechanism and Multi-Head Attention for Classification (SNA-MHC), is specifically designed to optimize classification accuracy in BCI systems. In our approach, raw EEG signals corresponding to motor imagery (MI) tasks are first normalized and then transformed into discrete spike trains using threshold encoding to make them suitable for processing by Spiking Neural Networks (SNN). These spike signals are subsequently processed by the SAMPN-Network model, which performs feature extraction by integrating a soft attention mechanism with the SNN module. The SNN module utilizes pulse neurons to encode and enhance the temporal information in EEG signals. Concurrently, the soft attention mechanism calculates attention weights to automatically focus on critical segments of the EEG signals associated with MI tasks while suppressing background noise and irrelevant temporal information, thereby extracting more precise time-series features. Following timesequence feature extraction, a Multi-Head Attention Mechanism performs parallel attention computation across time domain, frequency domain, and more abstract feature spaces. This approach captures interdependencies between features across different dimensions and enhances the discriminative power of the classifier. Finally, the integrated features are processed by a Softmax classifier to perform four-class classification of MI tasks. Experimental results demonstrate that the proposed SNA-MHC model outperforms existing state-of-the-art models in terms of classification accuracy on both the TechBrain and BCI Competition IV2a datasets. Specifically, SNA-MHC achieves an average classification accuracy improvement of 13.02%, 4.41%, 8.46%, 15.05%, and 15.88%, respectively, when compared to other algorithmic models. Furthermore, when compared to traditional CNN and SNN models, SNA-MHC exhibits superior energy efficiency while maintaining classification accuracy, further validating its robust performance.