## 2 Materials and Methods
### Model  
#### 2.3.1 Deep Learning Model: Geoman  
In this study, we used a deep learning model including a multi-level attention mechanism, known as Geoman. It was originally developed to perform geographic sensor time-series predictions, such as for air quality and water quality [44]. The structure was modified from the original Geoman framework and is shown in Figure 2. Geoman combines the advantages of the attention mechanism and LSTM by distinguishing the importance of multiple time-series data to preserve key spatiotemporal information. The attention module in Geoman consists of spatial and temporal attention. The spatial attention includes two sub-modules, namely global spatial attention that expresses the inter-site correlations, and local spatial attention that expresses the intra-site correlations. The temporal attention in the decoder stage captures the time dependencies. LSTM learns interactions at multiple timescales and can be extended to encoder and decoder modules [60]. Limited by the availability of ecological data, and also by differences in the spatial density between ecological observation sites and other geographic monitoring sites, including loop detector systems and urban groundwater monitoring systems, we only used local spatial attention to describe the dynamic correlation between each local feature and the target series. For simplicity, in this paper the term 'Geoman' refers to the model without global spatial attention. The local spatial attention mechanism can be expressed simply by Equations (2) and (3).  
\[e_{t}^{k}=\mathbf{v}_{t}^{T}tanh\ \left(\mathbf{W}_{l}\left[\mathbf{h}_{t-1}; \mathbf{s}_{t-1}\right]+\mathbf{U}_{l}\ \mathbf{x}^{k}+\mathbf{b}_{l}\right) \tag{2}\]  
\[\alpha_{t}^{k}=\frac{\exp\left(e_{t}^{k}\right)}{\sum_{j=1}^{N_{l}}\exp\left(e _{t}^{j}\right)} \tag{3}\]  
where \([;]\) represents concentration operation. \(\mathbf{v}_{l},\mathbf{b}_{l}\in\mathbb{R}^{T}\), \(\mathbf{W}_{l}\in\mathbb{R}^{T\times 2m}\) and \(\mathbf{U}_{l}\in\mathbb{R}^{T\times T}\) are learnable parameters and are determined by the back-propagation algorithm during the training process. The superscript T is the time window of input data. \(\mathbf{h}_{t-1}\in\mathbb{R}^{m}\) and \(\mathbf{s}_{t-1}\in\mathbb{R}^{m}\) are the hidden state and cell state at time \(t-1\), constituting the short-term memory and long-term memory in the LSTM encoder, respectively. The superscript \(m\) is the number of hidden neurons in LSTM. \(N_{l}\) denotes the number of feature variables. \(\mathbf{x}^{k}\) is the \(k\)-th local feature, namely the environmental variables (VT, Ta, PAR, EVI, PRE, SOCD, or SoilTex) of the flux sites. \(e_{t}^{k}\) is the correlation score between the \(k\)-th local feature and the target series (i.e., RE). Its size is determined by the local input feature \(\mathbf{x}^{k}\) and historical state information (\(\mathbf{h}_{t-1}\) and \(\mathbf{s}_{t-1}\)). \(\alpha_{t}^{k}\) is the attention weight calculated by normalizing the score of the \(k\)-th feature using a softmax function, and represents the relative importance of the \(k\)-th feature to the target series. After training, \(\alpha_{t}^{k}\) was obtained from the trained Geoman prediction process. The external factor fusion module can fuse other relevant features affecting the RE, such as elevation and weather forecasts. The weather forecasts used in this study refer to Ta and PRE at the time stamp of the predicted RE, and provide time-related factors to further improve the prediction accuracy.