# IeALL: Dam Deformation Prediction Model Based on Combination Model Method
## 5 Dam Deformation Prediction Model Based on Spatio-Temporal Correlation and IEALL
### Spatio-Temporal Attention Mechanism  
(1) Spatial attention mechanism  
The dam Deformation monitoring data of several measuring stations interact with each other and are dynamic to a certain extent, that is, they will change with the change of time, space and other factors. In order to enable the model to self-adaptively calculate the dynamic correlation between measurement points, this section takes the spatio-temporal correlation of numerous measurement points as a foundation and introduces the spatio-temporal attention mechanism. The following equation can be used to determine the spatial attention mechanism:  
\[S=V_{5}*\sigma((X_{t}W_{1})W_{2}\big{(}W_{3}X_{t}\big{)}^{T}+b_{S}\big{)} \tag{19}\]  
Among them, the \(X_{t}\in\mathbb{R}^{N\times T\times D}\) as the input of \(t\) time, \(V_{S}\in\mathbb{R}^{N\times N}\), \(W_{1}\in\mathbb{R}^{T}\), \(W_{2}\in\mathbb{R}^{D},W_{3}\in\mathbb{R}^{T\times D}\) and \(b_{S}\in\mathbb{R}^{N\times N}\) are to be learning parameters, \(\sigma\) as the activation function. The attention matrix \(S\in\mathbb{R}^{N\times N}\) is obtained by dynamic calculation based on the input data of the current layer. \(S_{i,j}\) represents the degree of influence of node \(j\) on node \(i\) semantically.  
Then, the _softmax_ function is used to normalize \(S\in\mathbb{R}^{N\times N}\), and map it to a real number between \([0,\ 1]\), so that the output result is the probability representation of the classification being taken, and the normalization can make the sum of the probabilities \(1\). Let \(S^{\prime}\) represent for the normalized SoftMax attention matrix, then the computation equation is as follows:  
\[S^{\prime}_{i,j}=softmax(S_{i,j})=\frac{\exp(S_{i,j})}{\sum_{j=1}^{N}\exp(S_{i,j})} \tag{20}\]  
The values in the matrix represent the attention weights between nodes. When features in the network need to be extracted, the spatial attention matrix \(S^{\prime}\in\mathbb{R}^{N\times N}\) should be combined with the matrix representing the graph structure to dynamically adjust the influence weights between nodes and allocate attention reasonably, and then the subsequent  
Figure 4: Overall framework diagram of STAGCN-IEALL.  
feature extraction operation should be carried out. The spatial attention mechanism is shown in Figure 5.  
2 Temporal attention mechanism  
The time dimension can be used to describe the correlation of a certain measurement point of dam deformation at different times, and the correlation will also change dynamically at different times. Therefore, the temporal attention mechanism is introduced at the same time to adaptively adjust the weights of different times. The specific calculation equation is as follows:  
\[E=V_{e}*\sigma\big{(}({X_{t}}^{T}U_{1})U_{2}\big{(}U_{3}X_{t})^{T}+b_{e}\big{)} \tag{21}\]  
\[E_{i,j}^{\prime}=\frac{\exp(E_{i,j})}{\sum_{j=1}^{T}\exp(E_{i,j})} \tag{22}\]  
where \(X_{t}\in\mathbb{R}^{N\times T\times D}\), \(V_{e}\in\mathbb{R}^{N\times N}\), \(U_{1}\in\mathbb{R}^{N}\), \(U_{2}\in\mathbb{R}^{D}\), \(U_{3}\in\mathbb{R}^{D\times N}\), and \(b_{e}\in\mathbb{R}^{T\times T}\) are all learnable parameters, \(\sigma\) is the activation function, \(E\) is the non-standardized attention matrix. Similarly, \(E^{\prime}\) represents the attention matrix standardized by the SoftMax function, and \(E_{i,j}^{\prime}\) represents the degree of influence of time \(j\) on time \(i\). When the network features need to be further extracted, the weights at different times can be dynamically adjusted by combining the normalized time attention matrix, and attention can be allocated reasonably, and then the subsequent time feature extraction can be carried out.