Lightweight electroencephalogram identity recognition method and system based on space-time attention mechanism

Through a lightweight EEG identity recognition method based on the spatiotemporal attention mechanism, the problems of complex EEG identity recognition algorithm model and high resource requirements are solved, and lightweight and high-precision EEG identity recognition is achieved, which is suitable for portable devices.

CN120705538APending Publication Date: 2025-09-26CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510674394.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing EEG identity recognition algorithms have complex models, require multiple channels and long time period signals, resulting in difficult deployment and poor practicality.

Method used

A lightweight EEG identity recognition method based on the spatiotemporal attention mechanism is adopted, including preprocessing, coordinate attention mechanism, improved EEGNet network and lightweight temporal self-attention module. By reducing the number of parameters and channels, the feature extraction and temporal dependency modeling capabilities are improved.

Benefits of technology

While maintaining recognition accuracy, the model is lightweight and suitable for portable or resource-constrained EEG identity recognition application scenarios, with good practicality and deployment advantages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705538A_ABST
    Figure CN120705538A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight electroencephalogram identity recognition method and system based on a space-time attention mechanism, and relates to the technical field of brain-computer interfaces, and the lightweight electroencephalogram identity recognition method based on the space-time attention mechanism mainly comprises the following steps: preprocessing an electroencephalogram signal to obtain a preprocessed electroencephalogram signal; extracting spatial features and channel information of the preprocessed electroencephalogram signals by using a coordinate attention mechanism to obtain weighted electroencephalogram signals; performing feature extraction on the weighted electroencephalogram signals by using an improved EEGNet network to obtain multi-channel features; and performing time feature extraction on the multi-channel features by using lightweight time self-attention, and inputting full-connection layer classification to obtain an identification result. According to the lightweight electroencephalogram identity recognition method and system based on the space-time attention mechanism, the model lightweight can be kept, and the electroencephalogram signal recognition precision can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of brain-computer interface technology, and more specifically, to a lightweight EEG identity recognition method and system based on a spatiotemporal attention mechanism. Background Art

[0002] Biometric systems have become an integral part of modern life, widely used in personal identification scenarios ranging from mobile phone unlocking to security monitoring. Currently, mainstream biometric technologies, including fingerprint recognition, facial recognition, and iris scanning, are popular for their ease of use and high accuracy. However, these technologies have limitations in liveness detection and are susceptible to duplication or forgery. Furthermore, because their signatures are exposed to the external environment, they are susceptible to spoofing attacks, posing a security risk to the system. EEG-based identity recognition technology, due to its unforgeability and liveness-based acquisition capabilities, is increasingly being incorporated into identity recognition systems.

[0003] However, existing EEG identification algorithms face several challenges. Traditional machine learning classification methods have made significant progress in this area, but these methods often require tedious feature extraction to convert raw EEG signals into input features that can be used by the classifier. This process requires extensive domain knowledge and experience and is often very time-consuming. However, deep learning methods offer new possibilities. Deep learning models, particularly neural networks, can automatically learn features from raw data, reducing the reliance on manual feature engineering and improving classification accuracy.

[0004] Current deep learning-based EEG identification algorithms still face several challenges. First, to improve identification rates, some algorithms tend to introduce more complex models, resulting in excessively large parameters and hindering deployment on hardware devices. Second, some algorithms reduce the number of parameters, but often require more channels or longer time periods to ensure EEG identification accuracy. However, using too many channels or longer time periods increases the complexity of data acquisition and the system burden in practical applications, thus affecting their practicality.

[0005] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention

[0006] The purpose of the present invention is to provide a lightweight EEG identity recognition method and system based on the spatiotemporal attention mechanism, which can improve the accuracy of EEG signal recognition while keeping the model lightweight.

[0007] The present invention provides a lightweight EEG identity recognition method based on a spatiotemporal attention mechanism, comprising the following steps: S1: preprocessing the EEG signal to obtain a preprocessed EEG signal; S2: using a coordinate attention mechanism to extract spatial features and channel information of the preprocessed EEG signal to obtain a weighted EEG signal; S3: Using the improved EEGNet network to extract features from the weighted EEG signal to obtain multi-channel features; S4: Use lightweight temporal self-attention to extract temporal features from the multi-channel features and input them into the fully connected layer for classification to obtain the recognition results.

[0008] Furthermore, the above preprocessing includes bandpass filtering and normalization.

[0009] Furthermore, step S2 specifically includes: S21: performing one-dimensional global pooling on the EEG signal along the horizontal and vertical directions respectively to obtain horizontal feature representation and vertical feature representation; S22: cascading and 1×1 convolution on the horizontal feature representation and the vertical feature representation to obtain an intermediate feature map; S23: performing batch normalization and nonlinearization on the intermediate feature map and then splitting it into a first independent branch tensor and a second independent branch tensor along the spatial dimension; according to the first independent branch tensor and the second independent branch tensor, using 1×1 convolution to obtain a first channel attention factor and a second channel attention factor respectively; S24: using the first channel attention factor and the second channel attention factor to perform weighted adjustment on the EEG signal to obtain a weighted EEG signal.

[0010] Furthermore, the improved EEGNet network includes a VOV-GSCSP module, a depth convolution module and a separable convolution module connected in sequence; the VOV-GSCSP module is used to perform two-dimensional convolution on the input data to extract features, and the GSBottleneck module is used to further extract features and then fuse them with the features extracted by the two-dimensional convolution, and then perform two-dimensional convolution to obtain new features.

[0011] Furthermore, step S4 specifically includes: dividing the multi-channel features into multiple channel groups according to the number of attention heads, each group corresponds to one attention head, and obtaining channel group features; using sine and cosine functions to position encode each time step; adding the position code to each channel group feature respectively, and performing attention calculation in parallel within each group; splicing the output of each attention head together and inputting it into the fully connected layer to obtain the recognition result.

[0012] The present invention also provides a lightweight EEG identity recognition system based on a spatiotemporal attention mechanism, comprising the following modules: a preprocessing module, configured to preprocess the EEG signal to obtain a preprocessed EEG signal; a coordinate attention module, configured to extract the spatial features and channel information of the preprocessed EEG signal using the coordinate attention mechanism to obtain a weighted EEG signal; a channel feature extraction module, configured to extract features of the weighted EEG signal using an improved EEGNet network to obtain multi-channel features; a time feature extraction module, configured to extract time features of the multi-channel features using lightweight temporal self-attention and input them into a fully connected layer for classification to obtain recognition results.

[0013] Furthermore, the above preprocessing includes bandpass filtering and normalization.

[0014] Furthermore, the coordinate attention module is specifically configured as follows: performing one-dimensional global pooling on the EEG signal along the horizontal and vertical directions respectively to obtain horizontal feature representation and vertical feature representation; cascading and 1×1 convolving the horizontal feature representation and the vertical feature representation to obtain an intermediate feature map; performing batch normalization and nonlinearization on the intermediate feature map and then splitting it into a first independent branch tensor and a second independent branch tensor along the spatial dimension; according to the first independent branch tensor and the second independent branch tensor, using 1×1 convolution to obtain a first channel attention factor and a second channel attention factor respectively; using the first channel attention factor and the second channel attention factor to weightedly adjust the EEG signal to obtain a weighted EEG signal.

[0015] Furthermore, the improved EEGNet network includes a VOV-GSCSP module, a depth convolution module and a separable convolution module connected in sequence; the VOV-GSCSP module is used to perform two-dimensional convolution on the input data to extract features, and the GSBottleneck module is used to further extract features and then fuse them with the features extracted by the two-dimensional convolution, and then perform two-dimensional convolution to obtain new features.

[0016] Furthermore, the above-mentioned temporal feature extraction module is specifically configured as follows: dividing the multi-channel features into multiple channel groups according to the number of attention heads, with each group corresponding to one attention head, to obtain channel group features; using sine and cosine functions to positionally encode each time step; adding the positional encoding to each channel group feature, and performing attention calculations in parallel within each group; splicing the outputs of each attention head together and inputting them into the fully connected layer to obtain the recognition result. Implementing the lightweight EEG identity recognition method and system based on the spatiotemporal attention mechanism provided by the present invention has the following beneficial effects: The present invention addresses the problems of complex models, large number of channels required, and reliance on long-time period signals in the existing EEG identity recognition algorithms. First, the original EEG signals are preprocessed to improve the effectiveness of subsequent feature extraction; then a coordinate attention mechanism is introduced to enhance spatial feature extraction capabilities and highlight key channel information; further, based on the EEGNet network structure, the VOV-GSCSP module is used to replace its first convolutional layer to improve the model's feature expression capabilities without significantly increasing the number of parameters; finally, a lightweight temporal self-attention module is integrated to effectively model the temporal dependencies across time steps while maintaining the model's lightweight, thereby improving overall discrimination performance. While ensuring recognition accuracy, this method has the advantages of a lightweight model structure, a small number of channels required, and a short signal duration. It has good practicality and deployment advantages and is suitable for portable or resource-constrained EEG identity recognition application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which: Figure 1 This is a flow chart of a lightweight EEG identity recognition method based on spatiotemporal attention mechanism provided by the present invention; Figure 2 This is the overall network architecture provided by the present invention; Figure 3 It is a coordinate attention structure diagram provided by the present invention; Figure 4 This is a structural diagram of the VOV-GSCSP module provided by the present invention.

[0018] Figure 5 This is a graph of experimental results of the motor imagery state data test based on the Physionet dataset provided by the present invention. DETAILED DESCRIPTION

[0019] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.

[0020] Figure 1 A schematic diagram of a lightweight EEG identity recognition method based on a spatiotemporal attention mechanism of this embodiment is shown. In this embodiment, the lightweight EEG identity recognition method based on a spatiotemporal attention mechanism includes the following steps: S1: preprocessing the EEG signal to obtain a preprocessed EEG signal; In an exemplary embodiment, the preprocessing includes bandpass filtering and normalization; S2: using a coordinate attention mechanism to extract spatial features and channel information of the preprocessed EEG signal to obtain a weighted EEG signal; In an exemplary embodiment, step S2 specifically includes: S21: performing one-dimensional global pooling on the EEG signal in the horizontal and vertical directions respectively to obtain a horizontal feature representation and a vertical feature representation; S22: Concatenate and perform 1×1 convolution on the horizontal feature representation and the vertical feature representation to obtain an intermediate feature map; S23: performing batch normalization and nonlinearization on the intermediate feature map and splitting the intermediate feature map into a first independent branch tensor and a second independent branch tensor along the spatial dimension; obtaining a first channel attention factor and a second channel attention factor using 1×1 convolution respectively according to the first independent branch tensor and the second independent branch tensor; S24: performing weighted adjustment on the EEG signal using the first channel attention factor and the second channel attention factor to obtain a weighted EEG signal; S3. Using an improved EEGNet network to extract features from the weighted EEG signal to obtain multi-channel features; In an exemplary embodiment, the improved EEGNet network includes a VOV-GSCSP module, a depthwise convolution module, and a separable convolution module connected in sequence; the VOV-GSCSP module is used to perform two-dimensional convolution on the input data to extract features, and further extract features using the GS Bottleneck module, which are then fused with the features extracted by the two-dimensional convolution, and then subjected to two-dimensional convolution to obtain new features; S4: Using lightweight temporal self-attention to extract temporal features from the multi-channel features and inputting them into the fully connected layer for classification to obtain recognition results; In an exemplary embodiment, step S4 specifically includes: dividing the multi-channel features into multiple channel groups according to the number of attention heads, each group corresponding to one attention head, to obtain channel group features; using sine and cosine functions to perform position encoding on each time step; adding the position encoding to each channel group feature, and performing attention calculation in parallel within each group; splicing the output of each attention head together and inputting it into a fully connected layer to obtain a recognition result; This embodiment provides a lightweight EEG identity recognition system based on a spatiotemporal attention mechanism, comprising the following modules: a preprocessing module, configured to preprocess the EEG signal to obtain a preprocessed EEG signal; a coordinate attention module, configured to extract the spatial features and channel information of the preprocessed EEG signal using the coordinate attention mechanism to obtain a weighted EEG signal; a channel feature extraction module, configured to extract features of the weighted EEG signal using an improved EEGNet network to obtain multi-channel features; and a temporal feature extraction module, configured to perform temporal feature extraction on the multi-channel features using lightweight temporal self-attention and input the extracted features into a fully connected layer for classification to obtain a recognition result.

[0021] In an exemplary embodiment, the preprocessing includes band-pass filtering and normalization.

[0022] In an exemplary embodiment, the coordinate attention module is specifically configured as follows: performing one-dimensional global pooling on the EEG signal along the horizontal and vertical directions respectively to obtain a horizontal feature representation and a vertical feature representation; cascading and 1×1 convolving the horizontal feature representation and the vertical feature representation to obtain an intermediate feature map; performing batch normalization and nonlinearization on the intermediate feature map and then splitting it into a first independent branch tensor and a second independent branch tensor along the spatial dimension; according to the first independent branch tensor and the second independent branch tensor, using 1×1 convolution to obtain a first channel attention factor and a second channel attention factor respectively; using the first channel attention factor and the second channel attention factor to weightedly adjust the EEG signal to obtain a weighted EEG signal.

[0023] In an exemplary embodiment, the improved EEGNet network includes a VOV-GSCSP module, a depth convolution module and a separable convolution module connected in sequence; the VOV-GSCSP module is used to perform two-dimensional convolution on the input data to extract features, use the GS Bottleneck module to further extract features and then fuse them with the features extracted by the two-dimensional convolution, and then perform two-dimensional convolution to obtain new features.

[0024] In an exemplary embodiment, the above-mentioned time feature extraction module is specifically configured as follows: the multi-channel features are divided into multiple channel groups according to the number of attention heads, each group corresponds to an attention head, and channel group features are obtained; each time step is position-encoded using sine and cosine functions; the position code is added to each channel group feature respectively, and attention calculations are performed in parallel within each group; the output of each attention head is spliced ​​together and input into the fully connected layer to obtain the recognition result.

[0025] In some embodiments, the above-mentioned lightweight EEG identity recognition method based on spatiotemporal attention mechanism can also be implemented in the following way.

[0026] In this embodiment, the lightweight EEG identity recognition method based on the spatiotemporal attention mechanism includes: Step 1: Preprocess the EEG signal by bandpass filtering and normalization; Step 2: Introduce the coordinate attention mechanism to enhance the ability to extract spatial features and channel information of EEG signals to highlight key channels; Step 3: Based on the EEGNet network structure, the first layer of the ordinary convolutional layer is replaced with the VOV-GSCSP module to enhance the model's ability to model spatial features without significantly increasing the number of parameters; Step 4: Introduce a lightweight temporal self-attention module to capture dependencies across time steps and improve the model's temporal discrimination ability.

[0027] Specifically, in step 2, the coordinate attention mechanism is used to process the EEG signal, specifically: Perform one-dimensional global pooling on the input EEG signal in the horizontal and vertical directions respectively to obtain feature representations in two directions; The feature maps in the two directions are cascaded and feature transformed by 1×1 convolution to obtain an intermediate feature map; The intermediate feature map is split into two independent branches along the spatial dimension, and restored to the same number of channels as the input through two 1×1 convolutions to obtain two channel attention factors; The channel attention factor is used to perform weighted adjustment on the input EEG signal to enhance the key channel information.

[0028] Specifically, the VOV-GSCSP module in step 3 is designed by constructing GSBottleneck using the lightweight convolution method GSConv, and then using a one-shot aggregation method. Compared to traditional convolution, the VOV-GSCSP module demonstrates more powerful expressiveness in feature learning while maintaining high computational efficiency without significantly increasing computational cost.

[0029] Specifically, in step 4, a lightweight temporal self-attention module is used to extract temporal features from the input features, specifically: Divide the input features into multiple channel groups by channel, and each group corresponds to an attention head; Position encoding at each time step using sine and cosine functions; Add position encoding to each channel group feature separately, and perform attention calculation in parallel within each group; Concatenate the outputs of each attention head together.

[0030] In some embodiments, the above-mentioned lightweight EEG identity recognition method based on spatiotemporal attention mechanism can also be implemented in the following way.

[0031] Combine Figure 2 The specific process of the lightweight EEG identity recognition method based on the spatiotemporal attention mechanism in this embodiment is as follows: Step 1: Obtain an EEG identification dataset. This example uses the Physionet dataset. Step 2: Band-pass filter the data set at 7-30 Hz and normalize it; Step 3: Introduce coordinate attention to process EEG signals to enhance the acquisition of EEG signal spatial features and highlight key channels; Step 4: Based on EEGNet, the VOV-GSCSP module is used to replace the first layer of ordinary convolution of EEGNet, which improves the model's ability to express the characteristics of EEG signals without significantly increasing the number of parameters; Step 5: Integrate a lightweight temporal self-attention module to effectively capture the dependencies of time steps while keeping the model lightweight, thereby improving the time series modeling capabilities.

[0032] Combine Figure 3 , the specific process of introducing the coordinate attention mechanism to process EEG signals is as follows: for the input x∈R C×1×T (where C represents the number of EEG signal channels and T represents the number of sampling points). Pooling kernels of size (1,1) and (1,T) are used to encode each channel in the horizontal and vertical directions respectively. Subsequently, the two feature maps generated by the above modules are concatenated and transformed through a shared 1x1 convolutional layer F1 to obtain the intermediate feature map x1. Next, x1 is split into two independent tensors f along the spatial dimension. u ∈R C / r×1 and f v ∈R C / r×T . Then, two 1x1 convolution F u and F v , respectively, the feature map f u and f v Transform to the same number of channels as the input x. Finally, the obtained g u and g v As the channel attention factor, the input x is weighted and adjusted to obtain x2∈R C×1×T , so that the network can focus on key channel information in both horizontal and vertical directions.

[0033] To illustrate the implementation of the network structure, we use motor imagery data from the Physionet dataset as an example. The original data has 64 channels, and a single experiment is sampled at 160 Hz for 4 seconds. This experiment uses a 4-second time period with 8 channels, and the network input size is 8 × 1 × 640. Because the input and output sizes of the coordinate attention mechanism are the same, the output size after the coordinate attention mechanism is 8 × 1 × 640.

[0034] Based on EEGNet, VOV-GSCSP replaces the first layer of EEGNet ordinary convolution, so the signal passes through the VOV-GSCSP module, the depth convolution layer and the separable convolution layer in sequence. As mentioned above, the input size is 8×1×640. First, the dimension is transformed to convert the signal input into 1×8×640. Then the data enters the VOV-GSCSP module and combines Figure 4The data first undergoes 2D convolution to extract features before entering the GS Bottleneck module. The core of this module is the GSConv architecture, which combines the advantages of standard convolution and depthwise separable convolution. GSConv decomposes the computation by performing channel-by-channel and space-by-space convolutions, reducing computational complexity while maintaining excellent feature extraction capabilities. The features extracted by the GS Bottleneck module are fused with the features from the previous 2D convolution and then undergo another 2D convolution to generate new features with an output size of 64×8×640. The data then enters the depthwise convolution layer. In this module, each channel is grouped independently, and each group of input channels is convolved with 64 convolution kernels of size (8,1) to produce 64 independent output channels, bringing the total number of output channels to 128 after the depthwise convolution. Rectified linear units (ReLUs) are then used as activations, and an average pooling layer with a kernel size of (1,8) and a stride of (1,8) is used for dimensionality reduction. The resulting output data has 128 channels and a size of 1x80. Next, we enter the separable convolution. Specifically, we perform point convolution on the features after depthwise convolution with a convolution kernel of size (1,1) for cross-channel information fusion. This not only reduces the model parameters but also improves computational efficiency. After ReLU activation and an average pooling layer with a kernel size of (1,8) and a stride of (1,8), the output data becomes 128 channels and a size of 1×10. It should be noted that EEGNet is a compact convolutional neural network (CNN) designed specifically for electroencephalogram (EEG) signal processing, mainly used for signal classification and feature extraction in brain-computer interface (BCI) tasks (see https: / / arxiv.org / pdf / 1611.08024.pdf).

[0035] The lightweight temporal self-attention module mainly includes position encoding and multi-head self-attention mechanism. First, the E channels are divided into H groups, and the size of each group is E ' = E / H, each channel group corresponds to an attention head. Then the position of each time step is encoded using sine and cosine functions. The position encoding is then copied to each channel group, and each attention head operates in parallel on its corresponding channel group. The query q of each head h It is no longer generated by linear transformation, but directly used as a learnable parameter of the model and updated during training. h The sum of the input data and position encoding is obtained by linear transformation. Next, each head calculates the attention mask a based on the dot product between the query and the key h , attention mask a h Used to weight the input signal and generate the output O of each head h Finally, the output of each attention head O hwere spliced ​​together.

[0036] As mentioned above, the module input data size is 128×1×10. To adapt to the subsequent network, the data is transformed into 10×128 dimensions, where 10 represents the time step and 128 represents the number of channels. The lightweight temporal self-attention module first groups the channels. Here, the number of attention heads is set to 8, so there are also 8 channel groups. Therefore, the data size processed by each attention head is 10×16. Each time step is then positionally encoded, copied and added to the data processed by each attention head. The data size processed by each attention head is still 10×16. Each head generates an attention mask based on the query and key to weight the signal. The query size is set to 128×1, and the key size is 10×128. The dot product of the query and key generates a weight of 10×1. This is applied to the input data, and each attention head obtains an output of 16×1. The output of 8 attention heads is then concatenated and flattened to obtain a one-dimensional vector of 128 dimension. The classification result is then output through a fully connected layer.

[0037] Combine Figure 5 , we can see the loss and accuracy curves on the training and validation sets when testing and training the lightweight convolutional neural network of this embodiment on the motor imagery data of the Physionet dataset. As the number of training rounds increases, the model's loss decreases before leveling off, and the model's classification accuracy rapidly improves to a high level. The final average accuracy achieved on the Physionet dataset reaches 98.34%.

[0038] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.

Claims

1. A lightweight EEG identity recognition method based on spatiotemporal attention mechanism, characterized by: The following steps are involved: S1: preprocessing the EEG signal to obtain a preprocessed EEG signal; S2: using a coordinate attention mechanism to extract spatial features and channel information of the preprocessed EEG signal to obtain a weighted EEG signal; S3: Using the improved EEGNet network to extract features from the weighted EEG signal to obtain multi-channel features; S4: Use lightweight temporal self-attention to extract temporal features from the multi-channel features and input them into the fully connected layer for classification to obtain the recognition results.

2. The lightweight EEG identity recognition method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The preprocessing includes band-pass filtering and normalization.

3. The lightweight EEG identity recognition method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: Step S2 specifically includes: S21: performing one-dimensional global pooling on the EEG signal in the horizontal and vertical directions respectively to obtain a horizontal feature representation and a vertical feature representation; S22: Concatenate and perform 1×1 convolution on the horizontal feature representation and the vertical feature representation to obtain an intermediate feature map; S23: performing batch normalization and nonlinearization on the intermediate feature map and splitting the intermediate feature map into a first independent branch tensor and a second independent branch tensor along the spatial dimension; obtaining a first channel attention factor and a second channel attention factor using 1×1 convolution respectively according to the first independent branch tensor and the second independent branch tensor; S24: Using the first channel attention factor and the second channel attention factor to perform weighted adjustment on the EEG signal to obtain a weighted EEG signal.

4. The lightweight EEG identity recognition method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The improved EEGNet network includes a VOV-GSCSP module, a depth convolution module and a separable convolution module connected in sequence; the VOV-GSCSP module is used to perform two-dimensional convolution on the input data to extract features, and the GS Bottleneck module is used to further extract features and then fuse them with the features extracted by the two-dimensional convolution, and then perform two-dimensional convolution to obtain new features.

5. The lightweight EEG identity recognition method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: Step S4 specifically includes: dividing the multi-channel features into multiple channel groups according to the number of attention heads, each group corresponds to one attention head, and obtaining channel group features; using sine and cosine functions to perform position encoding on each time step; adding the position encoding to each channel group feature respectively, and performing attention calculation in parallel within each group; splicing the output of each attention head together and inputting it into the fully connected layer to obtain the recognition result.

6. A lightweight EEG identity recognition system based on spatiotemporal attention mechanism, characterized by: The system includes the following modules: The preprocessing module is configured to: preprocess the EEG signal to obtain a preprocessed EEG signal; A coordinate attention module is configured to: extract spatial features and channel information of the preprocessed EEG signal using a coordinate attention mechanism to obtain a weighted EEG signal; The channel feature extraction module is configured to: extract features from the weighted EEG signal using an improved EEGNet network to obtain multi-channel features; The temporal feature extraction module is configured to: use lightweight temporal self-attention to extract temporal features from the multi-channel features and input them into the fully connected layer for classification to obtain recognition results.

7. The lightweight EEG identity recognition system based on spatiotemporal attention mechanism according to claim 6 is characterized in that: The preprocessing includes band-pass filtering and normalization.

8. The lightweight EEG identity recognition system based on spatiotemporal attention mechanism according to claim 6 is characterized in that: The specific configuration of the coordinate attention module is: Performing one-dimensional global pooling on the EEG signal in the horizontal and vertical directions respectively to obtain horizontal feature representation and vertical feature representation; Concatenate the horizontal feature representation and the vertical feature representation and perform 1×1 convolution to obtain an intermediate feature map; After batch normalization and nonlinearization, the intermediate feature map is split into a first independent branch tensor and a second independent branch tensor along the spatial dimension; a first channel attention factor and a second channel attention factor are obtained by using 1×1 convolution according to the first independent branch tensor and the second independent branch tensor respectively; The EEG signal is weighted and adjusted using the first channel attention factor and the second channel attention factor to obtain a weighted EEG signal.

9. The lightweight EEG identity recognition system based on spatiotemporal attention mechanism according to claim 6 is characterized in that: The improved EEGNet network includes a VOV-GSCSP module, a depth convolution module and a separable convolution module connected in sequence; the VOV-GSCSP module is used to perform two-dimensional convolution on the input data to extract features, and the GS Bottleneck module is used to further extract features and then fuse them with the features extracted by the two-dimensional convolution, and then perform two-dimensional convolution to obtain new features.

10. The lightweight EEG identity recognition system based on spatiotemporal attention mechanism according to claim 6 is characterized in that: The temporal feature extraction module is specifically configured as follows: dividing the multi-channel features into multiple channel groups according to the number of attention heads, each group corresponding to one attention head, to obtain channel group features; using sine and cosine functions to perform position encoding on each time step; Add position encoding to each channel group feature separately, and perform attention calculation in parallel within each group; The output of each attention head is concatenated and input into the fully connected layer to obtain the recognition result.