## 2 Materials and Methods
### Methodology Framework
#### 2.2.1 Discrete Cosine Transform  
The real-world datasets contain rich frequency information and so do the time series datasets. In order to take full advantage of the frequency information in time series data and better determine the hidden data of the series, this paper introduces DCT to turn time domain information into frequency domain information. DCT is similar to Fourier Transform [13], but DCT achieves better time-frequency energy compression characteristics than Discrete Fourier Transform (DFT), and there is no redundant data in the resultant sequence [13]. Therefore, DCT can extract the frequency information in the time series well. \begin{table}
\begin{tabular}{c c} \hline \hline
**Hyperparameters** & **Search Space** \\ \hline optimizer & \{Adam, SGD\} \\ hidden\_size of BiLSTM & \{1, 2,..., 15\} \\ sequence length & \{1, 2,..., 20\} \\ epochs & \{5, 10, 15, 20,..., 40\} \\ batch size & \{16, 32, 64, 128\} \\ learning rate & \{0.1, 0.001, 0.0001\} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Search space of Neural Network Intelligence. Figure 1: Methodology framework of this study. The DCT of a one-dimensional sequence of length \(N\)[22] is defined as  
\[\text{F}(u)= c(u){\sum_{x=0}^{N-1}}f(x)cos\bigg{[}\frac{(x+0.5)\pi}{N}u\bigg{]} \tag{2}\]  
where \(u{=0,\ 1,\ 2,\ \ldots,\ N-1,\) F is the transformed sequence, \(cos\Big{[}\frac{(x+0.5)\pi}{N}u\Big{]}\) is called forward DCT transformation kernel, \(f(\cdot)\) is the original sequence, and \(c(u)\)[22] is a compensation coefficient defined as  
\[c(u)= \begin{cases}\sqrt{\frac{1}{N}},u=0\\ \sqrt{\frac{2}{N}},u\
eq 0\end{cases}  \tag{3}\]  
Long Short-Term Memory Neural Network  
LSTM, a type of Recurrent Neural Network (RNN), offers advancements over traditional RNNs by effectively addressing both short-term and long-term dependency issues. Notably, LSTM demonstrates the capability to retain crucial information from early sequences even within lengthy sequences, making it a compelling choice for numerous applications [23]. In recent years, the LSTM neural network is widely used in air quality prediction. Fundamentally, LSTM architecture comprises three pivotal gates: the input gate, forget gate, and output gate, as depicted in Figure 2.  
As shown in Figure 2, the inputs and outputs of the network on the LSTM structure are described as follows:  
\[f_{t}=\sigma\Big{(}W_{f}\cdot[h_{t-1},x_{t}]+b_{f}\Big{)} \tag{4}\]  
\[i_{t}=\sigma(W_{i}\cdot[h_{t-1},x_{t}]+b_{i}) \tag{5}\]  
\[\widetilde{C}_{t}=tanh(W_{c}\cdot[h_{t-1},x_{t}]+b_{c}) \tag{6}\]  
\[C_{t}=f_{t}*C_{t-1}+i_{t}*\widetilde{C}_{t} \tag{7}\]  
\[o_{t}=\sigma(W_{o}\cdot[h_{t-1},x_{t}]+b_{o}) \tag{8}\]  
\[h_{t}=o_{t}*tanh(C_{t}) \tag{9}\]  
\[\sigma(x)=\frac{1}{1+\text{e}^{-x}} \tag{10}\]  
Figure 2: Structure of LSTM. \[tanh(x)=\frac{\mathrm{e}^{x}-\mathrm{e}^{-x}}{\mathrm{e}^{x}+\mathrm{e}^{-x}} \tag{11}\]  
where \(f_{t}\) represents the forget gate, \(i_{t}\) represents the input gate, \(\overset{\sim}{C}_{t}\) is a vector created by the \(tanh\) layer for the new candidate value, \(C_{t}\) refers to the cell state, \(o_{t}\) represents the output gate, \(h_{t}\) refers to the hidden state, \(W_{f},W_{i}\), \(W_{c}\) and \(W_{o}\) are input weights, \(b_{f},b_{i},b_{c},b_{o}\) are bias weights, \(t\) denotes the current state, and \(t-1\) denotes the previous state. \(\sigma\) and \(\tan h\) are activation functions. Bidirectional Long Short-Term Memory Neural Network  
The BiLSTM model, an extension of the LSTM architecture, comprises two LSTM layers: a forward LSTM layer and a backward LSTM layer. Among them, the forward LSTM processes the sequence in the forward direction and the backward LSTM processes the sequence in the reverse direction, and the outputs of the two LSTMs are spliced together after the processing is completed [11]. Figure 3 presents a schematic representation of the BiLSTM model structure. As can be seen in Figure 3, BiLSTM can process both forward and backward time series using two LSTMs.