## 3 Wind Speed Prediction Model Based on CEEMDAN-RIME-MHSA-BiLSTM  
### MHSA-BiLSTM Model Structure  
When dealing with time series data, BiLSTM models are widely used because of their ability to capture the backward and forward dependencies of sequence data. However, when dealing with long sequence data, it may be difficult to effectively characterize long-distance temporal dependencies using BiLSTM, resulting in an insufficient ability to capture key information in the sequence. To overcome this problem, in this study, we adopted the multi-head self-attention mechanism to improve the BiLSTM model framework, aiming to enhance the model's ability to characterize long sequence data and improve the prediction accuracy. The model framework mainly comprises an input layer, two BiLSTM layers, a multi-head self-attention mechanism, a fully connected layer, and an output layer. The model architecture is shown in Figure 5.  
1. The decomposed IMFs are fed into the model, and the input layer receives the subseries data (\(X=[X_{1},X_{2},\ldots,X_{T}]\)), which represent the eigenvalues of the different time steps in the time series;
2. The input data are passed for processing in the first-layer BiLSTM, which has \(n\) neural units containing both forward and backward LSTM. The first-layer BiLSTM processes the data between the time steps \(t=1\) and \(t=T\); the output of the forward LSTM at time step t is \(Y_{t}^{f}\) and the output of the backward LSTM is \(Y_{t}^{b}\). The outputs of the two directions are concatenated at each time step to form the output of the first layer (i.e., the \(2n\) dimensional vector (\(Y=\left[Y_{t}^{f},Y_{t}^{b}\right]\)));  
Figure 5: Diagram of MHSA-BiLSTM model framework. 3. The output of the first BiLSTM layer is passed as input to the second BiLSTM layer, which has \(m\) neural units. This layer further extracts the deeper features of the time series and generates a new output matrix of dimension \(2m\left(Z=\left[Z_{t}^{f},Z_{t}^{b}\right]\right)\);
4. The generated feature matrix goes to the multi-head self-attention mechanism module. This mechanism highlights the most relevant parts of the current prediction by calculating the correlation between each time step and other time steps and assigning them different weights. Outputs of the multiple attention heads are concatenated and linearly combined to generate a weighted \(T\times 2m\) feature matrix (\(A=\left[A_{t}^{f},A_{t}^{b}\right]\)) that further captures the important dependencies between the time steps;
5. Eventually, the feature matrix processed by the self-attention mechanism is passed to the fully connected layer. The fully connected layer maps these high-dimensional features to a final output value (\(O_{T}\)), such as a prediction of the future wind speed. This output value is the prediction made by the model for the input subsequence. In order to further improve the BiLSTM performance in dealing with long series data, CEEMDAN and the RIME algorithm are fused based on the original MHSA-BiLSTM model framework. This fusion method not only decomposes the time series but also optimizes the parameters of the BiLSTM, which significantly improves the prediction performance of the model. The input time series is first decomposed using CEEMDAN to obtain different components (IMFs). Next, a BiLSTM model containing a multi-head self-attention mechanism is defined, and its parameters are optimized via the RIME algorithm. Finally, the model generates final predictions through a training process. The CEEMDAN-RIME-MHSA-BiLSTM algorithm is shown in Algorithm 1:  
```
1:Input: Time series data \(X\), BiLSTM parameters, RIME optimizer parameters
2:Output: Predicted wind speed values \(\hat{y}\)
3: Decompose \(X\) using CEEMDAN into Intrinsic Mode Functions (IMFs):
4:\(\{IMF_{1},IMF_{2},\dots,IMF_{n}\}\gets CEEMDAN(X)\)
5. Initialize BiLSTM model parameters and RIME optimizer.