1. Introduction
As a leading technology in the field of clean energy, proton-exchange membrane fuel cells (PEMFCs) offer a promising solution for sustainable power generation due to their high efficiency and low emissions [
1,
2,
3]. The advantages of PEMFCs include high power density, compact size, being lightweight, and having a low operating temperature [
4]. Therefore, PEMFCs have been widely applied in various fields, from transportation to stationary power generation and portable electronics [
5,
6].
Nevertheless, widespread adoption of PEMFCs is hindered by issues related to degradation over time, which impacts their performance and reliability [
7]. The degradation of a PEMFC stack is mainly caused by the degradation of membranes, including physical defects and chemical degradation. Physical defects, such as cracks and pinholes, mainly caused by repeated swelling and shrinking of the membrane during operation, can exacerbate fuel permeation and reduce proton selectivity. Chemical degradation can be attributed to the attack of side reaction products such as hydrogen peroxide on the weak parts of the membrane, reducing the proton conductivity and overall durability of membranes [
8]. Factors such as membrane degradation, catalyst poisoning, and water and thermal management challenges contribute to the gradual decline in efficiency and output of PEMFC systems [
9,
10]. The degradation not only reduces the operational lifespan of the fuel cells but also increases maintenance costs and the risk of unexpected failures. Therefore, accurate prediction of PEMFC degradation is crucial for enhancing the longevity and efficiency of PEMFCs, as well as for optimizing maintenance schedules and ensuring operational safety.
In the realm of PEMFC degradation prediction, a number of methodologies have been explored. These methods can be broadly categorized into three main approaches: model-driven, data-driven, and hybrid approaches [
11].
Model-driven approaches predict the degradation trend of PEMFCs by creating degradation models based on physical and chemical principles. These models are obtained through analyzing the ageing mechanism [
12] or fitting empirical formulas [
13]. Pei et al. [
14] revealed the important effect of hydrogen crossover on fuel cell ageing, then developed a series of linear and nonlinear formulae to evaluate the lifetime of fuel cells. Wang et al. [
15] proposed a new degradation model based on polarization resistance which was combined with a particle filter (PF) to forecast the future degradation trend of PEMFC. Ao et al. [
16] utilized a frequency-domain Kalman filter to predict PEMFC voltage degradation under constant and dynamic conditions and concluded that the FDKF method offers superior accuracy and reduced computation time compared to the extended Kalman filter (EKF) method. Model-driven approaches offer detailed and explicable predictions of PEMFC degradation, but existing models have difficulties in explaining the nonlinear features in a degradation profile.
Data-driven approaches utilize machine learning and artificial intelligence techniques to forecast degradation trends. These approaches analyze and predict the ageing process of PEMFCs based on historical data without establishing complex physical or mathematical models. Many sorts of neural network approaches are extensively utilized in PEMFC prognostics [
17]. Convolutional Neural Networks (CNNs) can effectively extract local degradation features from measurement data while maintaining high computational efficiency, and they were first utilized for PEMFC prediction in 2020 [
18]. Benaggoune et al. [
19] proposed a multi-step-ahead prediction of PEMFC degradation trends based on a stacked dilated CNN with an attention block, then developed a conditional CNN to track long-term ageing trends. Recurrent neural networks (RNNs) have attracted widespread interest in regard to fuel cell performance prediction due to their ability to handle sequential data and capture temporal dependencies. However, traditional RNN structures face significant challenges like gradient explosion and gradient vanishing [
20]. To overcome this, various variants of RNNs have been utilized, such as long short-term memory (LSTM) [
21,
22], gated recurrent unit (GRU) [
23], and echo state network (ESN) [
24,
25]. Zuo et al. [
26] applied an attention mechanism to RNNs, comparing the predictive performance of two RNN architectures, LSTM and GRU, in long-term durability tests of fuel cells. It was demonstrated that the attention-based GRU showed the highest precision. Recently, the transformer model has also been gradually applied to PEMFC prediction. Lv et al. [
27] utilized the transformer model for PEMFC long-term degradation prediction for the first time. Meng et al. [
28] employed the segmented filtering and masking mechanisms to tackle the issues of the recovery of reversible voltage, which significantly improved the prediction accuracy. In addition, a variety of other deep learning methods have been applicated in PEMFC degradation prediction. For instance, Wu et al. [
29] proposed an advanced self-adaptive relevance vector machine (RVM) for PEMFC performance prediction. While data-driven approaches are model-free, their reliance on data quality and availability can be a limitation.
Hybrid approaches integrate the model-driven approaches and data-driven approaches to improve prediction accuracy and robustness. Ma et al. [
30] utilized a hybrid method based on extended Kalman filter (EKF) and LSTM to forecast the PEMFC degradation trend under multiple operational conditions. To overcome the drawback of LSTM in parallel computing, Hu et al. [
31] utilized a transformer model to forecast the trend and local fluctuation information of the ageing factor, while the ageing factor was described by a Wiener process model. Peng et al. [
32] emphasized the impact of health recovery phenomena on PEMFC prognostics. The entire prediction process was divided into voltage prediction with recovery identification, trend prediction, and fluctuation prediction, and the results were then obtained through a hybrid approach based on particle filter (PF) and random forest (RF). Hybrid approaches offer enhanced accuracy compared to model-driven or data-driven approaches but face problems in terms of high complexity and computational cost.
Traditional methods for predicting PEMFC degradation often face limitations in terms of striking a balance between accuracy and complexity, particularly when dealing with complex, dynamic operating conditions. This paper aims at presenting a data-driven method with high precision and simplicity to perform PEMFC degradation prediction. Among the variants of RNNs, LSTM is the most commonly applied in PEMFC degradation prediction. However, a GRU exhibits comparable performance with a simpler structure and fewer parameters. Considering these advantages, this paper establishes a prediction framework based on GRU.
The precision of the degradation prediction is not only related to sample selection but also to the hyperparameter of the GRU network. To further improve the predictive performance, this paper introduced a grey wolf optimizer (GWO) to optimize the hyperparameters of the GRU network. Thus, this article presents a gated recurrent unit model integrated with a GWO algorithm (GWO-GRU) to predict the PEMFC degradation. The main contributions of this paper are given as follows:
- (a)
This paper establishes a data-driven framework based on a gated recurrent unit (GRU) network to model the PEMFC degradation process. Compared with other RNNs, GRU has a more concise architecture and can provide a similar nonlinear prediction performance.
- (b)
A grey wolf optimizer (GWO) is integrated with the GRU framework to automatically adjust the parameters and structure of the network, which effectively improve prediction performance and balance the precision and complexity.
- (c)
The performance of the proposed method was validated based on durability test data of PEMFCs under actual operating conditions, exhibiting high precision and stable generalization performance.
The remainder of this paper is organized as follows.
Section 2 provides a detailed description of the PEMFC degradation data and data-processing procedure.
Section 3 explains the prediction method in this article and its detailed implementation steps.
Section 4 validates the performance of the presented method and provides an analysis of the prediction results. Finally, in
Section 5, conclusions are drawn.
2. Data Acquisition and Preprocessing
The data utilized in this paper were acquired from the IEEE PHM 2014 Data Challenge, provided by the FCLAB Research Federation [
33]. FCLAB conducted two experiments on the PEMFC test bench shown in
Figure 1a, and critical data were recorded for developing a new technique in PEMFC prognostics and health management. The first experiment is conducted under constant load conditions. A 1 kW PEMFC stack consisting of five cells operated under a constant current of 70 A for more than 1100 h. The second experiment is a durability test under dynamic load conditions, and the experimental parameters are illustrated in
Table 1. In the second experiment, a 70 current with 7 A high frequency ripples was applied to another identical PEMFC stack for more than 1000 h, and the data collected were utilized in this paper for model training and validation. The current curves in the two experiments are illustrated in
Figure 1b.
Some key physical parameters were recorded through the test bench, including voltage, temperature, pressure, etc. The voltage curves of the two experiments are shown in
Figure 2. The initial voltage under dynamic load is slightly higher than that under constant load, which may be attributed to the different initial responses of the active load under two different conditions. Nevertheless, it does not affect the voltage degradation trend. It is obvious that the stack voltage of both PEMFC stacks decrease with increasing experimental time and that dynamic load conditions accelerate the ageing process of the fuel cell stack. Therefore, the voltage degradation can indicate the degradation process of the PEMFCs, to some extent. During the test, characterization experiments were conducted approximately every week, including the polarization curve and electrochemical impedance spectroscope (EIS) measurement. After the characterizations, the PEMFC system recovered from reversible failures, leading to noticeable voltage recovery phenomena. These recoveries significantly enhanced the nonlinear features of the voltage profiles, especially under dynamic operational conditions.
In the PEMFC durability test under dynamic load conditions, more than 120,000 data points are obtained, and the voltage signal shows many noises and spikes, presenting challenges in terms of accurate prediction. Therefore, the original data have to be preprocessed before being utilized in model training. The raw data are reconstructed by calculating the average values per half hour; then, the data volume is reduced to 2042.
Subsequently, a Savitzky–Golay filter is applied for data smoothing. The S-G filter utilized a k − 1 order polynomial to fit the voltage data:
where
and
are the voltage and time samples, respectively, and
is the fitting coefficient.
Extend the filter window to
, then the above fitting process can be expressed in matrix form as:
where
and
represent voltage and time, respectively.
represents the fitting coefficients and
is the fitting error.
The filtered output voltage value
can be obtained by:
The raw, reconstructed, and smoothed voltage data under dynamic load conditions are demonstrated in
Figure 3. After preprocessing, abnormal signals and high-frequency noise in the raw data are eliminated, thus avoiding their negative impacts on the prediction process. The processed data can still represent the original trend of the raw data, which will be utilized for model training in
Section 3.
3. Methodology
In this section, a data-driven framework based on gated recurrent unit (GRU) and a grey wolf optimizer (GWO) is presented to forecast the PEMFC degradation process. The proposed data-driven framework establishes a mapping relationship between time, stack temperature, historical voltage, and PEMFC degradation voltage. The voltage and temperature data utilized were obtained through the data preprocessing method described in
Section 2.
By incorporating simplified gate mechanisms, the GRU method is advantageous in terms of reaching a balance between precision and simplicity. Additionally, a GWO algorithm is utilized to adjust and optimize the parameters of GRU to further enhance the predictive precision. The following contents provide a detailed description of the presented GWO-GRU approach.
Based on long short-term memory (LSTM), the GRU method further improves the structure of recurrent neural networks (RNNs). The GRU method combines the cell state and hidden state and replaces the forget gate and input gate in LSTM with a single update gate. Therefore, the training cost of the GRU model is significantly reduced compared to the LSTM model [
34].
The structure of GRU cells is illustrated in
Figure 4. In the structure, the update gate
determined whether the data should be retained or updated and reset gate
determined how much of the past information should be ignored. The outputs of the update gate and reset gate are formulated as follows, respectively:
where
represents the input at the current time step and
represents the hidden state from the previous time step.
With the output of reset gate, the candidate state
state can be calculated by
where the
the represents the multiplication of the vector elements.
Finally, the hidden state
can be obtained by
where
are the weight matrices and
are the corresponding bias.
The grey wolf optimizer is a metaheuristic algorithm inspired by the social hierarchy and hunting behaviour of grey wolves. In the wild, grey wolves usually act in small groups that consist of 5–12 individuals with different statuses. The wolves can be separated into four types, ranked by their leadership roles: alpha (α), beta (β), delta (Δ), and omega (ω) [
35]. The alpha wolves are the leaders, guiding the pack and making decisions. The beta wolves are subordinate to the alphas and assist in leadership decisions. The delta wolves rank third in the wolf pack, and they can control omega wolves. The omega wolves are the lowest-ranking members.
The hunting process of grey wolves can be described by the following equations
where
indicates the wolf position and
indicates the target position.
represents the distance between the wolf and its prey.
and
are the coefficient vectors that control the convergence of the solution, calculated by
where
and
are random vectors in [0, 1].
decreases from 2 to 0 linearly during iterations.
In a GWO, the wolves are considered as search individuals and the prey are considered as an optimal solution. However, unlike prey in the real world, the position of the optimal solution in abstract space is usually unknown. Therefore, the top three best solutions are considered as alpha (α), beta (β), and delta (Δ), respectively, and the other search individuals (ω) update their positions based on the positions of α, β and Δ. These processes are described by the following equations:
where
represents the position of the ω.
As the iteration progresses, the fluctuation range of the coefficient vector A decreases and the fluctuation range of the coefficient vector
decreases. As shown in
Figure 5, when
, the search individuals tend to depart from the current optimal solution and keep searching. The attacking phase begins as the wolves close in on the prey, which means
forces the individuals to approximate the optimal solution. In addition, the coefficient vector
effectively enhances the randomness of the algorithm and avoids local solutions.
The weights and biases of the GRU network are random initialized and automatically updated during model iterations, which can be considered as trainable parameters. In contrast, hyperparameters are parameters that are set to fixed values before the model training process, including learning rate, batch size, number of neurons, epochs, etc. These hyperparameters largely determine the structure, learning process, and final performance of the network, especially for deep neural networks with multiple hidden layers. It is evident that adjusting the hyperparameters of GRU networks through optimization algorithms is far more efficient than through experience. In this article, the GWO is introduced into the GRU network to optimize the learning rate, the number of neurons in hidden layers and the max epochs. Based on the GWO’s strong global convergence, the performance of the GRU in dynamic PEMFC prediction is significantly improved. The schematic diagram of the presented GWO-GRU method is shown in
Figure 6, and a detailed optimization process is described as follows.
- (1)
Model initialization:
Build the GRU network and initialize the critical parameters based on the characteristics of the PEMFC ageing data. Construct multidimensional vectors utilizing hyperparameters that require optimization.
- (2)
Population initialization:
Initialize the parameters of the GWO algorithm, including the number of wolf packs, initial positions, and maximum number of iterations.
- (3)
Fitness calculation:
Calculate the fitness of each individual by training the GRU network with the specified hyperparameters determined by current positions. The fitness is evaluated by the mean squared error (MSE).
where
M is the number of samples.
and
represent the actual values and predicted values, respectively.
- (4)
Update the population:
Update the positions of alpha, beta and delta wolves, and then update the positions of all individuals in the wolf pack. Iterate repeatedly until the termination condition is reached.
- (5)
Model establishment:
Obtain the optimal hyperparameter vector from the GWO algorithm and apply it to the GRU framework to build the PEMFC degradation model.
4. Results
This section presents the predictive results of the PEMFC degradation process under dynamic load conditions. The prediction is multi-step, and the input and output window of the model are set to 40 h and 10 h, respectively. The training lengths are set to 50%, 60%, 70% and 80% of the entire dataset, respectively; thus, four groups of predictive results are obtained. To prove the effectiveness of the presented GWO-GRU method, the predictive results based on two standard methods are presented for comparison.
4.1. Performance Evaluation Metric
To evaluate the predictive performance, three statistical indicators, including the mean absolute percentage error (MAPE), the root mean square error (RMSE) and the coefficient of determination (R2) are applied as evaluation metrics:
in which
represents the amount of data,
and
are the actual values and predicted values, respectively, and
represents the average of the actual values.
Furthermore, the absolute percentage error (APE) is utilized to evaluate the variation in prediction error over time, formulated as follows
4.2. Experimental Results and Discussion
In order to validate the accuracy of the proposed GWO-GRU method, the prediction results of two additional standard methods, i.e., GRU and PSO-GRU, are provided in this section. The hyperparameters of the GRU method are manually adjusted before the training process, while the hyperparameters of the other two methods are given by optimization algorithms.
Figure 7 shows the predicted PEMFC voltage degradation trend under different methods and training lengths, and
Figure 8 shows the APE results. The five percent line in
Figure 7 is a critical line which means a five percent drop from the initial voltage. When the voltage of PEMFC stack is lower than the critical line, the ageing fault can be declared. The detailed evaluation indicators are illustrated in
Table 2.
The comparison between the standard GRU, PSO-GRU, and GWO-GRU methods demonstrates a clear improvement in prediction accuracy when optimization algorithms are applied. Additionally, across all training lengths, the predicted values of the presented GWO-GRU method are generally closer to the true values. For example, with 50% of the data used for training, GWO-GRU achieves an RMSE of 0.0020784, which is significantly lower than the 0.0044654 of the standard GRU model and even surpasses the performance of PSO-GRU (RMSE of 0.0032765). The same pattern can also be observed from the other two evaluation indicators, MAPE and R2.
It can be found in
Figure 8 that the presented method not only has the minimal relative error but also the minimal error fluctuations, exhibiting high stability and accuracy. The data show that the GWO algorithm leads to a better configuration of the GRU network compared to the PSO algorithm and shows a stronger effectiveness in PEMFC degradation prediction. The superior performance of the presented method can be attributed to the GWO’s stronger global search capabilities, allowing the model to better capture the complex, nonlinear degradation patterns in PEMFC systems. In
Table 2, the evaluation indicators shows that the presented method has reduced the prediction error by about 60–70% compared to the standard GRU model and by about 12–35% compared to the PSO-GRU model.
Upon analyzing the provided data in
Table 2, it becomes evident that increasing the training length does not consistently lead to improvements in prediction accuracy, regardless of the method used. In fact, the results suggest that adding more training data can, in some cases, slightly degrade performance. For example, in the GRU model, the RMSE increases from 0.0044654 at 50% training length to 0.0064539 at 80%, while GWO-GRU shows a similar trend, with RMSE increasing from 0.0016032 at 60% training length to 0.0020843 at 80%.
This counterintuitive effect is likely due to the inherent characteristics of PEMFC degradation data. In the early stages of operation, PEMFC degradation follows a more predictable pattern, making it easier for models to learn from relatively smaller datasets. However, as degradation progresses and becomes more complex—due to factors like membrane thinning, catalyst degradation, and water management issues—the prediction task becomes more challenging. As training length increases, the GRU networks become more prone to overfitting, especially if the data in the later stages include more nonlinear features. Nevertheless, adjusting the network configuration through the GWO algorithm can significantly reduce the possibility of overfitting and improve the accuracy of degradation prediction.
In summary, the presented GWO-GRU method exhibits better performance than other standard methods in PEMFC degradation prediction and presents stable prediction results under different sizes of training samples, achieving a balance between accuracy and complexity.
4.3. Comparison with Other Methods in the Literature
To further validate the effectiveness of the presented GWO-GRU method, the error results in
Table 2 are compared with some existing methods in recent studies. The comparison results are listed in
Table 3. It is evident that the proposed method shows the best performance in
Table 3, which further proves its superiority.
5. Conclusions
In this paper, a novel approach integrating the GRU neural network with a grey wolf optimizer (GWO) was proposed to predict PEMFC degradation process. The GWO-GRU method successfully addresses key challenges in accurately predicting PEMFC degradation, particularly under dynamic operational conditions. By adjusting hyperparameters of the network automatically through GWO, the method effectively balances prediction precision and complexity, demonstrating a significant improvement over standard methods.
The results obtained from validation utilizing a PEMFC durability test data show the superior performance of the GWO-GRU approach. The model reduced prediction error by approximately 60–70% compared to the standard GRU method and by 12–35% compared to the PSO-GRU method, showing its robustness and accuracy across various training data sizes. Additionally, the analysis revealed that increasing the training length did not consistently improve prediction accuracy, suggesting the importance of optimizing the model structure to avoid overfitting, especially in later degradation stages.
The presented GWO-GRU method shows strong potential for practical applications in PEMFC prognostics, where accurate and real-time predictions are essential for optimizing maintenance schedules and ensuring fuel cell system reliability. Future work will explore extending the method to more complex operational scenarios and further improving its scalability for larger datasets.