## 2 Methods
### Model  
In this section, we introduce our proposed method in detail, which corresponds to the three modules (b), (c), and (d) in Figure 1. Specifically, the following subsections elaborate on the SegPool Strategy, Multi-1D CNN, and BiRAU Module, respectively. **Random segment recombination strategy. ** Inspired by the Multi-clip Random Fragment Strategy [18], we proposed a data augmentation technique called SegPool for EEG signal classification. As shown in Figure 1b, the SegPool Strategy randomly slices and concatenates different task segments to create new combinations. The goal of this technique is to increase the diversity of the training data and improve the generalization performance of the model. SegPool comprises a random segment strategy and a recombination strategy. The random segment strategy is an effective approach to prevent models from overfitting to specific task patterns in EEG signal analysis. This method involves splitting EEG signals into short, fixed-length segments. These segments can be obtained from various tasks in the dataset used, thus increasing the variability of the training data. The EEG segments obtained through the random segment strategy are pooled together. Then, in the recombination stage, segments from different tasks are randomly combined to form various training examples. This process involves selecting segments and concatenating them randomly to create a new example. Figure 1: The pipeline of the proposed 1 DCNN-BiRAU network based on SegPool. (**a**) represents the preprocessing of raw EEG data, including filtering operations and slicing. (**b**) represents the strategy of SegPool. (**c**) represents the local and global 1D CNN module. (**d**) represents the bidirectional recurrent attention unit. The use of the recombination strategy in the SegPool provides an opportunity to create numerous new training examples with different combinations of task segments. By doing so, we can prevent the model from overfitting to specific task patterns, leading to more accurate EEG signal analysis. **Local and global 1D CNNs. ** Specifically, as depicted in Figure 1c, the 1D CNN takes a matrix with dimensions \(M\times N\) as input, where \(M\) is the length of the time window and \(N\) is the number of EEG channels. Each 1D convolutional layer uses a kernel of variable dimension \(Q\times N\), where \(Q\) is the temporal window covered by the filter. The mathematical notation of a 1D convolutional layer is as follows:  
\[y_{r}=f\left(\sum_{q=1}^{Q}\sum_{n=1}^{N}w_{qn}x_{r+q,r+n}+b\right) \tag{1}\]  
where \(y_{r}\) is the output of the unit \(r\) of the filter feature map of size \(R\) (\(R=M\) in the case stride = 1); \(x\) is the two-dimensional input portion overlapping with the filter; \(w\) is the connection weight of the convolutional filter; \(b\) is the bias term; and \(f\) is the activation function of the filter. In this work, we applied multiple layers of 1D CNN with different kernels sizes and numbers of kernels to extract hierarchical features from the EEG recordings. We used both local and global 1D CNNs, where the local CNN operates on single task segment and the global CNN operates on combinations of task segments. The output of the 1D CNN layers was a set of high-dimensional feature vectors, which were then passed to the BiRAU for further processing. **Bidirectional recurrent attention unit. ** As shown in Figure 1d, we used BiRAU to extract temporal relational features between EEG signals. RAU stands for recurrent attention unit [19], which is a type of RNN that can be used for sequence modeling and prediction tasks. Different from other attention mechanisms [20], an RAU architecture seamlessly integrates the attention mechanism into the cell of a GRU and allows the network to focus on different parts of the input sequence selectively.