## 3 Methodology  
### Long Short-Term Memory  
The LSTM network was proposed by [PERSON] et al. (2016) in 1997 based on an extension of RNN, which is mainly used to solve the problems that exist in traditional RNN, both gradient disappearance and explosion. The most fundamental difference between RNN and LSTM is that the hidden layer of the LSTM network is a gated unit, where information is added and removed through a 'gate' structure that learns which information to keep or forget during training. The LSTM has three types of gate structures: forgetting gates, input gates, and output gates (Figure 2a). The forgetting gate will decide which information should be forgotten from the neural network unit states, which is implemented by a sigmoid function. The gate is determined by the previous output, \(H_{t-1}\), and the new input, \(X_{t}\), to determine which information was  
Figure 2: (**a**) The structure of the LSTM neural network; (**b**) Structure of the phenology-based LSTM model. removed from the previous cell state, \(C_{t-1}\). The output is a number between 0 and 1, where 0 means that the information is completely discarded, and 1 means that the information is completely retained, and is calculated as in Equation (1):  
\[f_{t}=\sigma\Big{(}W_{f}.[X_{t},H_{t-1}]+b_{f}\Big{)} \tag{1}\]  
where \(\sigma\) is the sigmoid function, \(f_{t}\) is the forgetting gate, \(H_{t-1}\) denotes the output of the previous node, \(X_{t}\) denotes the current input, \(W_{f}\) is the forgetting gate weight, and \(b_{f}\) is the forgetting gate bias. The input gate determines which information should be stored from the neural network unit states. Implementing this requires two steps: first the sigmoid layer generates the activation value, \(i_{t}\), for the input gate based on \(H_{t-1}\) and \(X_{t}\). The tanh function creates a candidate vector state, \(c_{t}\), which is the alternative to be used for the update, calculated as in (2) and (3):  
\[i_{t}=\sigma(W_{i}.[X_{t},H_{t-1}]+b_{i}) \tag{2}\]  
\[c_{t}^{\prime}=tanh(W_{\text{C}}.[X_{t},H_{t-1}]+b_{c}) \tag{3}\]  
where \(i_{t}\) denotes the input gate output, \(c_{t}\) denotes the current candidate node state, \(W_{i}\) and \(W_{c}\) denote the weights of the input gate and the input candidate unit, respectively, and \(b_{i}\) and \(b_{c}\) denote the bias of the input gate and the input candidate unit, respectively. The old cell state, \(C_{t-1}\), is updated to the new cell state, \(C_{t}\), using the results obtained from the first two orders, calculated as in (4):  
\[C_{t}=f_{t}.C_{t-1}+i_{t}.\ c_{t}^{\prime} \tag{4}\]  
Finally there is the output gate, which determines which information in the cell state will be taken as the output of the current state. The sigmoid layer is first run, which determines which cell states are output; then the tanh value of the cell state is multiplied by the output of the sigmoid (normalize the output value) threshold, which ultimately gives the output new cell state \(H_{t}\), calculated as in (5) and (6). \[O_{t}=\sigma(W_{o}.[X_{t},H_{t-1}]+b_{o}) \tag{5}\]  
\[H_{t}=O_{t}.\tanh(C_{t}) \tag{6}\]  
where \(O_{t}\) denotes the output gate output, \(H_{t-1}\) denotes the output of the previous node, \(X_{t}\) denotes the current input, \(W_{o}\) denotes the output gate weight, and \(b_{o}\) denotes the output gate bias. In this study, the deep neural network model of LSTM winter wheat yield estimation based on the phenological stages is shown in Figure 2b. The input layers of this model are VIs, LAI, GPP, pr, tmmx, srad, and Pdsi for six growing stages of winter wheat. Two layers of LSTM layers are set, and other hyperparameters are set according to the results of Bayesian optimization algorithm in Section 3, with a total of six times steps. To prevent overfitting of the training data a dropout layer is added to the network architecture. All input data need to be normalized before being fed into the model and, finally, back-normalised for output.