## 3 Methodology
### Encoder
\[\hat{F}_{i}=CA(LN(F_{i}),LN(Z))+F_{i} \tag{4}\]  
where \(i\in\{1,2,\cdots,L\}\). The image feature after encoding by \(L\) Transformer blocks is \([F_{1},F_{2},\cdots,F_{L}]\in R^{N\times D}\). \(CA\) is the cross-attention operator function. In cross-attention, the global semantic feature \(F_{i}\) is used as the query \(Q\), and the multi-scale local spatial feature \(Z\) is used as the key \(K\) and the value \(V\). The global semantic feature and the multi-scale local spatial feature are linearly transformed, as shown in (5)-(7). \[Q=F_{i}W_{q}\in R^{N\times D} \tag{5}\]  
\[K=ZW_{k}\in R^{N\times D} \tag{6}\]  
\[V=ZW_{v}\in R^{N\times D} \tag{7}\]  
where \(N\) is the length of the sequence and \(D\) is the number of feature dimensions. \(W_{q}\), \(W_{k}\), and \(W_{v}\) are three trainable parameter matrices. Then, the degree of attention paid by the multi-scale local spatial features to the global semantic features, also known as the cross-attention weight, is obtained using dot product and _SoftMax_ operations. \[CrossAttention(Q,K)=SoftMax\bigg{(}\frac{QK^{\mathrm{T}}}{\sqrt{d}}\bigg{)} \tag{8}\]  
where \(d\) is the number of channels in each self-attentive header. Finally, the cross-attention weights are multiplied with \(V\) element by element in order to discern the information interaction between multi-scale local spatial features and global semantic features. \[\hat{Z}=Concat(Flatten(Z_{1},Z_{2},Z_{3})) \tag{2}\]0  
In order to update the multi-scale local spatial features so that they contain global semantic information, the module injects the global semantic features output from the \(i\)-th Transformer block into the multi-scale local spatial features. \[\hat{Z}=Concat(Flatten(Z_{1},Z_{2},Z_{3})) \tag{2}\]1  
Multi-scale local spatial features containing global semantic features are enhanced expressively by feed-forward neural networks (\(FFNN\)). The process can be represented as  
\[\hat{Z}=Concat(Flatten(Z_{1},Z_{2},Z_{3})) \tag{2}\]2  
where \(W_{1}\in R^{D\times 2D},W_{2}\in R^{2D\times D}\) is the learnable transformation matrix. In cross-attention, the global semantic feature \(Z\) is used as the query \(Q\), and the multi-scale local spatial feature \(F_{i}\) is used as the key \(K\) and the value \(V\). The global semantic feature and the multi-scale local spatial feature are linearly transformed. The arithmetic formula is the same as in (5)-(7). Then, the degree of attention paid by the global semantic features to the multi-scale local spatial features, also known as the cross-attention weight, is obtained using dot product and _SoftMax_ operations, and the calculation formula is the same as in (8). Finally, the cross-attention weights are multiplied with \(\mathbf{V}\) element by element in order to discern the information interaction between global semantic features and multi-scale local spatial features, and the calculation formula is same as in (9). The information injection module outputs both global semantic features containing multi-scale local spatial features and multi-scale local spatial features containing global semantic information. The global semantic features are transmitted to the Transformer block through the residual connection in order to achieve long-distance information modeling, which ensures that the global semantic features have a better response to different scales of mining areas. The multi-scale local spatial features are input to the next multi-scale local spatial feature complementary module as the multi-scale priori information of the next module, which enhances the model convergence and improves the model performance at the same time.