# Drilling Parameters Multi-Objective Optimization Method Based on PSO-Bi-LSTM
## 3 Results and Discussion
### Construction of ROP Prediction Model  
The drilling parameter optimization model is built upon the foundation of the rate of penetration (ROP) prediction model, aiming to achieve optimization objectives through the optimization of drilling parameters. As ROP serves as one of the objectives in drilling parameter optimization, it is essential to ensure the accuracy of the optimized ROP to guarantee the credibility of the optimization results. In this experiment, based on the LSTM, we introduced the bi-directional mechanism and bi-directional attention mechanism. We proposed the sliding window dynamic updating mechanism aiming at the specificity of predicting the time series of ROP. Finally, we implemented a prediction model of time series of high-frequency ROP based on Bi-LSTM. The overall structure of the model is shown in the following Figure 2.  
For this model, we also introduced the sliding window method to optimize parameters and update the model. The sliding window method takes a given sub-experimental window size and slides the window towards the future in time order with a fixed step size. The size of this window is generally much smaller than the total data size, and each window contains its own training data and label values. After training all the sub-experimental data, we predicted and calculated the total evaluation index on the test set. Based on the above, this experiment uses the sliding window method to divide the data set, using drilling data from wells in Xinjiang, China. By moving a fixed size window, sliding window technology can analyze and process input data, enabling various tasks such as feature extraction, object detection, and text segmentation. Although sliding window technology has advantages such as flexibility, multi-scale processing, and real-time performance, sliding windows require repeated calculations of data, which can lead to a decrease in computational efficiency. The length of the window size is very important, Inappropriate window size can lead to low efficiency and information loss. Therefore, this article designed a comparative experiment. From Table 1, it can be seen that when the window size is 50, the prediction effect is best, and compared to the fastest model, it only increases the calculation time by 30 s.  
So, the paper sets the slide window length to 50 and the step size to 1. That mean, because we have 1242 pieces of test data, and, starting from the first one, every 50 pieces of data is taken as one data window, there are 1242 data windows in total. We input the segmented ROP data into the established Bi-LSTM model. We input the drilling data of the wells in Xinjiang, China into the Bi-LSTM model. The iteration times set by this model is 100 times, the batch size is 64, and the initial learning rate is 0.001. The neural network optimization algorithm adopts the momentum batch gradient descent algorithm, namely the Adam algorithm. At the same time, we compared several common machine learning ROP prediction methods. The prediction results in test data are shown in Figure 3, and the prediction accuracy is shown in Table 2. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Number**} & \multicolumn{2}{c}{**The Length of**} & \multirow{2}{*}{**RMSE**} & \multirow{2}{*}{**MAE**} & \multirow{2}{*}{**Time (s)**} \\  & **Sliding Windows (m)** & & & \\ \hline
1 & 10 & 3.0218 & 1.9837 & 286 s \\
2 & 30 & 2.4256 & 2.0568 & 302 s \\
3 & 50 & 1.5169 & 0.9921 & 316 s \\
4 & 70 & 1.7894 & 1.2387 & 351 s \\
5 & 90 & 1.5474 & 0.9732 & 381 s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of effects of different sliding window lengths. Figure 2: The structure of the Bi-LSTM. It can be seen that the trend of the predicted value of the Bi-LSTM method in this experiment is roughly consistent with the actual value, and the prediction accuracy is the highest, which means that Bi-LSTM can accurately predict the ROP.