## 2 Materials and Methods
### Long Time Series Dependencies  
Due to the limitation of the convolution kernel, the traditional convolutional neural network is unsuitable for modeling timing problems. Recent studies have found that specific convolutional structures can achieve better results [33]. At first, the extended convolution of TCN was used to capture the long time mode. TCN can not only avoid the gradient disappearance and gradient explosion of RNN but also achieve the effect of modeling long time series. The TCN model uses the transformation of a one-dimensional fully convolutional network [34] to predict sequences, passing the sequence information through its multilayer network layer by layer until the prediction result is obtained.  
Specifically, the length of each EEG characteristic output by the modified ResNet block is T : \(\{f_{1},\dots,f_{T}\}\), through the TCN network, which can produce the predictive output of the same length Z : \(\{z_{1},\dots,z_{T}\}\). The structure of the TCN model is shown in Figure 5a. It can satisfy the \(f:f^{T+1}\to z^{T+1}\) mapping relationship, and because the causal limit, \(z_{T}\) only depends on the \(\{f_{1},\dots,f_{T}\}\), i.e., at time \(t\), the extended convolution's output depends only on time t and the inputs of the previous layer, not on any future inputs.  
The formula of extended convolution is defined as follows:  
\[H(K)=\sum_{i=0}^{j-1}f(i)\cdot X_{k-d\cdot i} \tag{11}\]  
where \(d\) is the expansion factor, \(j\) is the filter size, and \(k-d*i\) represents the past direction. When \(d=1\), the dilation convolution becomes a regular convolution, and the input range increases as d increases [35]; Figure 5c shows the change in the TCN network's field of view for \(d=3\). Thus, each layer of the TCN network can increase the perceptual field of  
Figure 5: (a) TCN network. (b) Residual block of the TCN network. (c) Residual block (k,d), (* represents multiplication sign).  
the TCN by increasing the dilation factor d or the filter size k [36], where the compelling history of one such layer is \((j-1)*d\).  
If we define \(L\) as the number of samples required for each iteration and derive a vector \(z=\{z_{i}\}\), where \(i=1,2,\ldots\) at each time step, the network \(F\) is created by minimizing the predicted value with the proper label. The expected loss is calculated between:  
\[F^{*}=F^{\text{min}}loss(f_{1},\ldots,f_{L},z_{1},\ldots z_{T}) \tag{12}\]  
At layer \(i\) of the network:  
\[d=O\Big{(}2^{i}\Big{)} \tag{13}\]  
This ensures that there are some filters to capture each input [32], thus achieving a long and compelling history. The residual block shown in Figure 5b is used to accelerate convergence and stability training. Residual connections can train deep networks and transfer information across layers. Each residual block has two convolution and nonlinear mappings that regularize the network using the WeightNorm and Dropout. A 1 \(\times\) 1 convolution reduces the dimension and solves the inconsistency of the number of channels in the feature graph. The residual block contains a branch whose output is added to the block's input \(x\) through a series of transformations:  
\[O=Activation(x+\varphi(x)) \tag{14}\]  
This effectively allows layers to learn changes to the identity map rather than the entire transformation, which has repeatedly proven beneficial for deep networks. In addition, the \(GeLUl\) function is still used as the activation function in TCN residual block.