## 2 Methods
### ANN Model Development  
When the hidden layer in the multilayer perceptron (MLP) has an appropriate activation function and a sufficient number of hidden layers and neurons, the MLP can estimate any function with any accuracy. The ANN used in this work is implemented by an MLP. The ANN architecture can be described as follows: the first layer of input variable feeding network is represented as the input layer, the final layer is called the output layer, and all layers between the input layer and output layer are called the hidden layer (as shown in Figure 1). All neural networks have an input layer and an output layer, but the number of hidden layers may vary.  
In this study, two different ANN structures are explored and their performances are tested. They are ANN with one-hidden-layer and ANN with two-hidden-layer. The initial number of neurons in each hidden layer is less than 20 [33]. The exact number of neurons, the learning rate and the number of training epochs in the current ANN are tested by a hyperparameter selection procedure. The data set has 12 groups of complete time-series data, of which 8 groups are randomly divided into train set, 2 groups into validation set, and 2 groups into the test set. The train set is used to train the ANN model, the validation set is used to select hyperparameter and select the best model, and the test set is used to check the generalization ability of the selected ANN model. The number of neurons in the hidden layer is 3-20, the learning rate is 0.001, 0.004, 0.007, 0.01 and 0.04, and the number of training epochs is within 200. The code automatically saves the model when we get a better model during validation. The validation of the forecasted model is based on the mean and maximum relative errors. Learning and building the ANN is done using the PyTorch library of the interpreted programming language Python.  
In DEA mode, PEM fuel cell works in the constant voltage mode, and the current density changes over time. In this study, 12 processes of the PEM fuel cell in the DEA mode with different operating conditions (voltage and inlet pressure) are simulated (as shown in Table 2). The duration for the DEA mode of each process is 200 s. The sampling time is 1 s. Therefore, the input layer of ANN has three neurons. When in DEA mode, they receive the following three parameters.  
1. Voltage;
2. Inlet pressure;
3. Time.  
In anode recirculation mode, PEM fuel cell works in the constant current mode, and the voltage changes over time. In this study, 12 processes of the PEM fuel cell in the anode recirculation mode with different operating conditions (current density and anode stoichiometry) are simulated (as shown in Table 3). The duration for the anode recirculation mode of each process is 600 s. The sampling time is 1 s. When in anode recirculation mode, they receive the following three parameters.  
1. Current density;
2. Anode stoichiometry;
3. Time.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & & \multicolumn{5}{c}{**Train Set**} \\ \hline Voltage, V & 0.7 & 0.6 & 0.6 & 0.7 & 0.5 & 0.4 \\ Inlet pressure, bar & 1.6 & 1.4 & 1.3 & 1.0 & 1.2 & 1.8 \\ \hline \multicolumn{5}{c}{**Train Set**} & **Validation Set** & **Test Set** \\ \hline Voltage, V & 0.4 & 0.5 & 0.5 & 0.6 & 0.6 & 0.7 \\ Inlet pressure, bar & 1.3 & 2.0 & 1.6 & 1.6 & 1.1 & 1.3 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Operating conditions of the twelve processes in the DEA mode.  
The input values are normalized before input. This is conducive to the improvement of the training speed and numerical performance of the ANN, so that the error in the training process can be smoothly reduced, and the accuracy of gradient estimation can be improved.