## 1 Introduction
### Global Brain-Level Encoding and Classification Module  
Emotions are distributed across various brain regions, and each region has temporal and spatial emotional characteristics. The brain is composed of networks, and emotions are associated with interactions among different brain regions. Therefore, emotional recognition performance can be improved by extracting spatiotemporal features from each brain region and learning global spatiotemporal features through interactions among brain regions and combining information. This helps us recognize emotions more accurately by simultaneously considering the activities of various brain regions. The global brain-level encoding model is a key module that can effectively learn spatiotemporal features extracted from various brain regions and improve emotion recognition performance by identifying globally distinct patterns according to various emotional states. Figure 6 shows the structure of the global brain-level encoding and classification model, which consists of BGRU, self-attention, and softmax. Unlike the regional brain-level encoder, which uses a two-layer BGRU, the global brain-level encoder uses a single-layer BGRU. This is because it is only used to combine information among brain regions based on spatiotemporal information sufficiently extracted from the regional brain-level. Figure 6: Architecture of the global brain-level encoder and classifier in the HSCFLM. The local spatiotemporal feature vector \(\mathbf{L}\) obtained through regional brain-level encoding is input into the BGRU layer, as shown in Equation (16), and the global context feature vector \(\mathbf{E}\) is obtained. \[\mathcal{BGRU}(\mathbf{L})=\mathbf{E}=\left[h_{1}^{G},h_{2}^{G},\ldots,h_{g}^{G }\right]\in\mathbb{R}^{2d_{g}\times 9} \tag{16}\]  
where \(d_{g}\) represents the dimension of each hidden unit state vector. Next, the extracted global context feature vector \(\mathbf{E}\) is input into the self-attention to extract a global spatiotemporal feature \(\mathbf{G}\). This is obtained using Equations (17) and (18):  
\[Attention\Big{(}\mathbf{Q^{G}},\mathbf{K^{G}},\mathbf{V^{G}}\Big{)}=softmax \Bigg{(}\frac{\mathbf{Q^{G}}\big{(}\mathbf{K^{G}}\big{)}^{T}}{\sqrt{d_{K^{G}}} }\Bigg{)}\mathbf{V^{G}} \tag{17}\]  
\[\mathbf{G}=Attention\Big{(}\mathbf{Q^{G}},\mathbf{K^{G}},\mathbf{V^{G}}\Big{)} \tag{18}\]  
where \(\mathbf{Q^{G}}\), \(\mathbf{K^{G}}\), and \(\mathbf{V^{G}}\) denote the query, key, and value, respectively, by the linear transformation of the input \(\mathbf{L}\). In addition, \(d_{K^{G}}\) represents the dimensions of key vector \(\mathbf{K^{G}}\). The global spatiotemporal feature \(\mathbf{G}\) extracted from the global brain-level encoder is input into the softmax classifier for emotional state prediction and used to calculate the probability distribution for the emotion classes. First, a linear transformation is performed on feature expression \(\mathbf{G}\) using the learned weight matrix \(W_{z}\) and bias vector \(b_{z}\), which is expressed in Equation (19):  
\[\mathbf{M}=W_{z}G+b_{z}=[v_{1},\ v_{2},\ldots,v_{c}] \tag{19}\]  
where \(c\) is the number of emotion categories for classification, and \(v_{i}\) represents the raw score for the i-th class. The obtained raw score \(\mathbf{M}\) is input into the softmax function to calculate the probability of each emotion class. The classifier outputs the class with the highest probability \(p\) as the recognized emotional state label. The calculation for \(p\) is as in Equation (20) below. \[p=max\Bigg{\{}\frac{exp(v_{j})}{\sum_{i=1}^{c}exp(v_{i})}|j=1,2,\ldots,c\Bigg{\}} \tag{20}\]  
Cross-entropy is used as the loss function for model training and is expressed in Equation (21). \[E=-\frac{1}{Z}\sum_{z-1}^{Z}Y_{z}\text{log}\bigg{(}\overset{\sim}{Y}_{z}(X_{z},\theta)\bigg{)}+\frac{\lambda}{2}\|\theta\|_{2}^{2} \tag{21}\]  
where \(X_{z}\) and \(Y_{z}\) denote the z-th EEG sequence and the label of the sequence, respectively.