# Shear Wave Velocity Prediction Based on the Long Short-Term Memory Network with Attention Mechanism
## 4 Prediction and Discuss
### Experiment 1  
The LSTM network overcomes the inadequacies of ANN in extracting contextual information by transmitting a hidden state so that it can make full use of association information to predict shear wave velocity. However, as the input information increases, the LSTM network may not be able to utilize the critical information in the data effectively. Therefore, this study introduces a new Attention-LSTM network, which enhances the ability to extract important information by introducing a self-attention mechanism. In experiment 1, we applied the Attention-LSTM network to the actual prediction of shear wave velocity and compared the results with ANN and LSTM. Table 2 lists the main parameters of ANN, LSTM, and Attention-LSTM networks. In Figure 10, the loss values for ANN, LSTM, and Attention-LSTM networks are shown. After a period of training, the loss values of the three neural networks reached a minimum, and there was no significant downward trend. It is evident that Attention-LSTM has a minimum loss value, from which we can conclude that the predicted shear wave velocity of the proposed network is closer to the actual value than that of the remaining two networks. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Network Name** & \begin{tabular}{c} **Input** \\ **Matrix** \\ \end{tabular} & **Layers** & \begin{tabular}{c} **Hidden** \\ **Neurons** \\ \end{tabular} & **Optimizer** & \
\begin{tabular}{c} **Loss** \\ **Value** \\ \end{tabular} &
\begin{tabular}{c} **Learning** \\ **Rate** \\ \end{tabular} \\ \hline Attention-LSTM & \(7\times 6\) & 2 & 10 & & \\ ANN & \(1\times 6\) & 4 & \(12\) & Adam & MAE & 0.001 \\ LSTM & \(7\times 6\) & 2 & 10 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Attention-LSTM, ANN, and LSTM main parameters. Figure 10: Attention-LSTM, LSTM, and ANN network loss values. To compare the performance differences of the three networks in predicting shear wave velocity, ANN, LSTM, and Attention-LSTM performed shear wave velocity prediction on the same training set, and the experimental results are shown in Figure 11. Although the predicted value of the three networks is very similar to the trend of the actual measured value, the predicted value of Attention-LSTM is closer to the real value at a depth of 4850-5000 m than that of the other two networks. As Figure 12 shows, the predictions of a single ANN or LSTM network deviate more severely from the actual values at specific depths. Still, the Attention-LSTM integration of the attention mechanism dramatically improved this phenomenon. In other words, the logging data combined with the self-attention mechanism can enhance the coincidence between the forecast curve and the measured curve while keeping the forecast trend unchanged. Figure 11: Prediction results of three different neural networks. (From left to right, the prediction effect of ANN, LSTM, and Attention-LSTM is shown, respectively). To more specifically compare the prediction accuracy of the three neural network methods, the evaluation scales MAE and R\({}^{2}\) were used to evaluate their prediction performance (Figure 13) quantitatively. The correlation coefficient between the predicted value and the actual measured value of the proposed network was 0.94, which is higher than that of the remaining two networks. At the same time, the mean absolute error (MAE) of Attention-LSTM was 51.4, which is also lower than the MAE of ANN and LSTM. The reason for the high R\({}^{2}\) and low MAE of Attention-LSTM is that the attention mechanism adaptively adjusts the log value. In conclusion, the Attention-LSTM improves the accuracy of shear wave prediction by adjusting the weights of important data on different curves. In this study, we propose an Attention-LSTM model that incorporates the Attention mechanism to improve the prediction accuracy of shear wave velocity in oil and gas wells.