## 1 Introduction
### Regional Brain-Level Encoding Module
Specifically, as shown in Figure 4, the BGRU has a structure in which a hidden layer that processes sequences in reverse order is added to the structure of the GRU [36], which consists of only forward layers that process input sequences sequentially. This structure allows the BGRU to learn long-term dependencies better than the GRU by considering both the past and future states of the input sequence. Figure 3: Overview of the regional brain-level encoder in the HSCFLM. The forward and backward context feature representations for an input sequence extracted via BGRU are as follows in (7) and (8):  
\[\overset{\rightarrow}{h}_{t}=\overrightarrow{\text{GRU}}_{f}(x_{t}),t\in[1,T] \tag{7}\]  
\[\overset{\leftarrow}{h}_{t}=\overleftarrow{\text{GRU}}_{b}(x_{t}),t\in[T,1] \tag{8}\]  
where \(\overset{\rightarrow}{h}_{t}\), \(\overset{\leftarrow}{h}_{t}\), \(\overrightarrow{\text{GRU}}_{f}\), \(\overleftarrow{\text{GRU}}_{b}\), and \(x_{t}\) denote the forward hidden sequence, backward hidden sequence, forward GRU, backward GRU, and the feature vector of the sample at time \(t\), respectively. \(\overset{\rightarrow}{h}_{t}\) is obtained by processing the input sample sequence in order from time step \(t=1\) to \(T\) through \(\overrightarrow{\text{GRU}}_{f}\), and \(\overset{\leftarrow}{h}_{t}\) is obtained by processing the data in reverse order from \(t=T\) to \(1\). The obtained forward and backward context feature vectors \(\overset{\rightarrow}{h}_{t}\) and \(\overset{\leftarrow}{h}_{t}\) are summarized in the bidirectional context feature expression \(h_{t}\), as shown in Equation (9), using a concatenation operation:  
\[\mathbf{H^{r}}=\left[c_{1}^{r},c_{2}^{r},\dots,\ c_{n}^{r},\dots,\ c_{N_{r}}^{ r}\right]\in\mathbb{R}^{d\times N_{r}} \tag{1}\]0  
The 2 BGRUA model builds two BGRU networks in series and adds a self-attention mechanism. In this hybrid model, the first BGRU layer extracts future and past time series EEG information, and the second BGRU layer is applied to learn more significant feature representation, while better emotional feature information is provided by assigning weights to contextual feature information using a self-attention mechanism. In general, self-attention can effectively model global interactions; however, it has limited disadvantages in figuring out local dependencies. In contrast, the BGRU can effectively identify regional dependencies that reflect bidirectional temporal patterns and flows within the input sequence. Therefore, we applied the BGRU before self-attention. Figure 5 shows the structure of the self-attention layer. First, each feature vector \(\widehat{\mathbf{H}}^{\mathbf{r}}\) and \(\widehat{\mathbf{U}}^{\mathbf{r}}\) output through the second BGRU layer is input into self-attention and is output as each query, key, and value by multiplying with the corresponding weight matrix, as shown in Equations (10) and (11):  
\[\mathbf{H^{r}}=\left[c_{1}^{r},c_{2}^{r},\dots,\ c_{n}^{r},\dots,\ c_{N_{r}}^{ r}\right]\in\mathbb{R}^{d\times N_{r}} \tag{1}\]1  
\[\mathbf{H^{r}}=\left[c_{1}^{r},c_{2}^{r},\dots,\ c_{n}^{r},\dots,\ c_{N_{r}}^{ r}\right]\in\mathbb{R}^{d\times N_{r}} \tag{1}\]2  
\[\mathbf{H^{r}}=\left[c_{1}^{r},c_{2}^{r},\dots,\ c_{n}^{r},\dots,\ c_{N_{r}}^{ r}\right]\in\mathbb{R}^{d\times N_{r}} \tag{1}\]3 Structure of the bidirectional gated recurrent unit. where \(\mathbf{Q^{C}}\), \(\mathbf{K^{C}}\), and \(\mathbf{V^{C}}\) denote the query, key, and value by the linear transformation of input \(\widehat{\mathbf{H}}^{r}\), respectively, and \(\mathbf{Q^{S}}\), \(\mathbf{K^{S}}\), and \(\mathbf{V^{S}}\) refer to the query, key, and value by the linear transformation of input \(\widehat{\mathbf{U}}^{r}\), respectively. \(W_{Q}^{C^{\prime}}\), \(W_{K}^{C^{\prime}}\), \(W_{V}^{C^{\prime}}\), \(W_{Q}^{S^{\prime}}\), \(W_{K}^{S^{\prime}}\), and \(W_{V}^{S^{\prime}}\) indicate the learnable weight matrices. Next, the similarity between the query and key vectors is calculated using the dot product.