## 3 Methods
### AnimalEnvNet Network
#### 3.2.3 Feature Fusion and Dimensionality Reduction  
The core of the Attention Mechanism is to compute the dot product between the query and the key to measure their correlation [40]. The formula is:  
\[\text{Attention}(Q,K,V)=softmax\bigg{(}\frac{QK^{T}}{\sqrt{d_{k}}}\bigg{)}V \tag{8}\]  
The term _Attention_ refers to the Attention Mechanism, where \(Q\) represents the query matrix, \(K\) represents the key matrix, and \(V\) represents the value matrix. The term softmax refers to the activation function known as softmax. The expression \(\frac{QK^{T}}{\sqrt{d_{k}}}\) represents the result of multiplying the transpose of the query matrix and the key matrix, and then dividing it by the square root of the dimension of the key. The symbol \(\sqrt{d_{k}}\) represents the square root of the dimension of the key matrix used for scaling. This study utilises a multi-head Attention Mechanism that involves several sets of distinct query, key, and value matrices. It calculates different attention weights for each set. Each attention head records distinct attention orientations and characteristic representations, allowing the model to concentrate on several levels, positions, or types of information concurrently. Through acquiring knowledge about the allocation of weight across several heads, the model effectively manages intricate inputs and derives comprehensive feature representations. The formula is as stated below:  
\[\text{MultiHead}(Q,K,V)=Concat(head_{1},...,head_{n})W^{O}head_{i}=Attention \big{(}QW^{Q}_{i},KW^{k}_{i},VW^{V}_{i}\big{)} \tag{9}\]  
This function takes three inputs \(Q\), \(K\), and \(V\). These are linearly transformed into multiple heads of attention using weight matrices \(W_{i}\), \(W^{k}_{i}\), and \(W^{V}_{i}\) for each head. \(W^{O}\) is another weight matrix used to linearly transform the concatenated outputs of the attention heads. Each \(head_{i}\) represents the result of applying attention for the \(i\)-th head. Within the module for extracting features from remote sensing images, we initially subject remote sensing images from various sources to multi-layer convolution blocks to extract their features. Afterward, the attention layer is utilised to combine these qualities. To synchronise the characteristics of various modalities, we modify the output of the trajectory feature extraction module to match the shape of the remote sensing image features. We then duplicate this modified output 128 times to create a three-dimensional feature with 128 channels and a size of (25, 25). Then, we merge the integrated remote sensing image features with the trajectory features to create a fusion feature that has 320 channels and a size of (25, 25). The combined feature is subjected to a multi-head attention method in order to further consolidate and enhance the correlation between features. Ultimately, the fusion features undergo a reduction process using multi-layer convolution blocks, resulting in two-dimensional features with dimensions of (25, 25). We developed two distinct kinds of output layers: one for continuous action spaces and another for discrete action spaces. Initially, the two-dimensional characteristics are compressed into one-dimensional vectors and fed into a fully connected layer with 625 hidden units, which represents the ultimate prediction outcomes. The completely connected layer in the continuous action space output layer produces a one-dimensional array of size 2, which predicts the distances of animal movement in the x- and y-directions. The output layer in the discrete action space consists of a fully connected layer that produces a one-dimensional array of size 2560. The output values are limited to a range of 0 to 1 using the sigmoid activation function. These values represent the one-hot encoding of the agent's movement direction and distance. In our study, we discretised the continuous variables, such as direction and distance, into bins and then applied one-hot encoding to these bins.