Fault diagnosis of PEMFC based on the AC voltage response and 1D convolutional neural network

The AC voltage response is the diagnostic input for a 1D convolutional neural network. It can accurately diagnose the health state (normal, ﬂooded, or dehumidiﬁed) of a two-cell PEM fuel cell stack in 1 s, demonstrating the potential for onboard diagnostics of fuel cells


INTRODUCTION
Fault diagnosis is critical for the safety and reliability of polymer electrolyte membrane fuel cell (PEMFC) systems. The stack (single cells arranged in series, the number of cells determining the power) as the core component of a PEMFC system needs to be operated under optimal conditions (such as temperature, pressure, and reactant stoichiometry). The deviation of the operating conditions from the optimum will accelerate the degradation of the stack and even cause the system to cease to function. For instance, pinholes caused by membrane dehydration can further lead to reaction gases mixing, triggering a direct combustion reaction. 1 Real-time assessment of fuel cell (FC) state of health (SoH) is traditionally only possible via simplistic measurements that do not require extensive sampling time or computational processing, such as voltage sensing of cells within a stack. Alternatively, many advanced diagnostic approaches to obtaining more detailed information about the operation of the FC require either intrusive measurements that halt the operation of the FC for unacceptable periods of time or changes to the stack architecture that allow for, for example, spectroscopic or imaging measurements to be taken [2][3][4] but that represent unrealistic working environments or are not possible to implement on a working stack onboard (e.g., within an automotive system). Therefore, real-time fault diagnosis techniques need to be developed to detect the health of the FC system and ensure its reliable operation in an unintrusive manner. 5 Data-driven or machine-learning (ML) techniques can provide a pathway to the rapid and detailed understanding of SoH using limited data inputs from unintrusive measurements. 6 Some problems, such as low pressure of reactant and temperature drop, can be measured directly by sensors, but faults related to membrane 7 or fuel starvation 8 cannot be measured directly by sensors. There is a correlation between specific signals in a PEMFC system and internal health states; for example, when a fault occurs, the output voltage decreases, and the pressure drop of the flow channel increases during flooding. 9 That is, changes in specific signals can reflect internal health status. This correlation is fundamental for the data-driven 10,11 or signal-based [12][13][14] approach to fault diagnosis. Generally, a model (data-driven) or standard (signalbased) is used to determine the SoH of the system by judging the input signal. Here, the model can be a classifier trained by a supervised ML algorithm, and the standard is defined as the threshold obtained by statistics. For non-supervised learning, the failure can be detected, but the class of faults is not specific if the ground truth is missing.
Individual cell voltage has been widely used as the original diagnostic variable for the SoH of the FC; [15][16][17] for example, single-cell failure can be detected by monitoring the voltage of each cell or a grouping of cells. Other faults can also cause variations in individual cell voltage, but the problem is how to relate the faults to the individual cell voltage distribution. ML approaches can solve this difficulty in analyzing complex and convoluted voltage signals. Li et al. 17 used Fisher discriminative analysis (FDA) and support vector machine (SVM) to achieve feature extraction and classification. The individual cell voltage signal is measured by the embedded system in real time and is projected into the feature space by FDA to reduce redundant information; then, the features are classified into different health states by SVM, a widely used classification method. 18 The authors pointed out that various health states would result in different spatial distributions of thermal, fluidic, and electrochemical reactions, leading to an inhomogeneous distribution of individual cell voltages. However, the relationship between the SoH and individual cell voltages' distribution is unclear. There is a strong correlation between the output voltage of the FC and the SoH, and the output voltage drops correspondingly when a fault occurs. Zheng et al. 19 transformed the voltage signal into frequency representations through short-time Fourier transform and then used them as the input of a reservoir-computing algorithm. The diagnostic accuracy of the test dataset for four different faults (CO poisoning, low air stoichiometry, excessive stack temperature, and natural degradation) reached 92.43%. In addition, Damour et al. 20 and Liu et al. 21 obtained 98.6% and 96.05% diagnostic accuracy for recognizing water management failures. This indicates that the output voltage can be used as the original variable of FC fault diagnosis. Still, there are the following problems: (1) the mode (the rate and the magnitude) of output voltage decline under different fault conditions is not determined, (2) the output voltage is greatly affected by temperature, pressure, and flow rate; even if there is no failure, there is also output voltage fluctuation, and (3) various operating conditions, including reactant pressure and flow rate, coolant temperature, and actuator status signals, are used as the input signals for fault diagnosis but only to identify water management failures. 22 For FC fault diagnosis, it is critical to find a kind of signal that can reflect various faults; that is, there needs to be a direct relationship between the fault type and the signal characteristics, which means that the fault type corresponds to the signal characteristics.
Electrochemical impedance spectroscopy (EIS) is a fundamental tool for FC research that can distinguish the influence of different processes such as ohmic resistance, ll OPEN ACCESS mass transfer, and charger transfer on the output voltage of the stack. [23][24][25][26][27][28][29][30] Le et al. 31 investigated the differences in impedance spectra for flooding, membrane drying, and CO poisoning. Membrane drying leads to an increase in impedance at all frequencies of the range used, and flooding increases the impedance at low frequency (<10 Hz). CO poisoning caused the impedance in the range of 100-300 Hz to rise. The EIS signature can also differentiate hydrogen leak and air starvation. 32 Zheng et al. 33 selected six key features from EIS spectra based on previous literature to reduce computational effort. Some particular features in the spectrum represent the health status of the stack, such as polarization resistance, which indicates the global performance, rather than using the whole spectrum. Then, fuzzy clustering obtains diagnostic rules to determine the different degrees of flooding/drying faults. Jeppesen et al. 34 extracted features from impedance spectra as an artificial neural network input. For the six different health states, the global accuracy of the test data is 94.6%. As features from EIS can be used as the original diagnostic variable, and EIS is calculated from the alternating current (AC) voltage response of small-amplitude sinusoidal perturbations (under galvanostatic mode). Therefore, the AC voltage response can directly serve as the original diagnostic variable to avoid the computation and time caused by time-frequency conversion while having the same advantage of discriminating between the influence of various operating conditions, as in EIS. In addition, traditional EIS also requires the FC to be at a steady state during each measurement. There are errors in the measurement results of EIS when faults occur (by their nature, inducing an unsteady state).
The AC voltage response can be measured in an unsteady state since EIS need not be calculated. One of the major problems encountered is that the input dimension (the AC voltage response length, for example, determined by both sampling time and frequency) is too high when the time-domain signal is used. It is also hard to choose the features by manual inspection. ML algorithms presented in the literature, such as conventional neural networks, cannot handle high input dimensions because each connection has a different weight. Conventional neural networks have too many training parameters. The one-dimensional (1D) convolutional neural network (CNN) with local parameter sharing and end-to-end properties can solve this problem. Instead of each neuron connecting to all neurons in the previous layer, each neuron connects to only a small number of neurons in the CNN, which reduces the number of parameters significantly. Therefore, the use of the AC voltage response as a diagnostic for electrochemical systems does not appear in the literature, to our knowledge; interpretation of the complicated and convoluted voltage response is not possible without the use of appropriate ML approaches, which are also not trivial to apply correctly and accurately.
Unoptimized water management 3,35 can adversely affect the performance and lifetime of the PEMFC system, and it is difficult to monitor water distribution and dynamics online using sensors. This study takes water management failure as an exemplar to verify the effectiveness of the proposed methodology by imposing a multi-frequency current perturbation on an operating stack and using the AC voltage response as the input for a 1D CNN for FC diagnostics. For the first time, to our knowledge, we demonstrate the ability to accurately diagnose water management faults in identifying experimental data from an operating FC stack via the combination of simultaneous multi-frequency AC perturbation and analysis of the

RESULTS AND DISCUSSION
In-sequence AC voltage response First, we consider the ability of EIS to distinguish the different faults within the FC stack, which is difficult to achieve through stack direct current (DC) voltage alone. 31 Figures 1D-1F show the Nyquist plots obtained during the PEMFC operation with different health states (see supplemental experimental procedures and Figures S1 and S2 for details). Compared with the normal state (60% relative humidity [RH]), the impedance of all frequencies increases under the dehydration fault (35% RH). Under the flooding fault (85% RH), the impedance mainly increases at low frequency.
However, the stack must be steady to obtain accurate impedance information. This is difficult to maintain in a faulty condition. The error occurs when the stack voltage fluctuates significantly, so the steady-state requirement of EIS measurement is not satisfied. Therefore, AC voltage response is directly considered as the original variable for fault diagnosis, as shown in Figures 1A-1C. It avoids the computation and error of time-frequency conversion compared with using the diagnostic signatures from the impedance. The fast Fourier transform (FFT) is a common method to realize time-frequency conversion, and its complexity is O(n log n), where n is the number of the points. Because there is a clear link between health and internal resistance, there is also a link between the AC voltage response under different health states. Various health states correspond to different amplitudes and phases at a specific frequency. For instance, the dehydration fault is represented by an increase in the amplitude of the voltage response for all frequencies. In contrast to the four-step diagnostic method proposed by Jeppesen et al., 34 the utilization of AC voltage signals in PEMFC system fault diagnosis only requires two steps: AC excitation and 1D CNN classification. This represents significant potential time and computation savings in diagnosis and avoids extra feature extraction/selection.

Structure for the proposed 1D CNN
Because of parameter sharing, 1D CNNs can process high-dimensional input and have been widely used in timing signal processing. 36 The filter is a fixed-length weight matrix convolved with the receptive field to obtain the neuron value at the next layer. The filter is learnable during the CNN training process. There is only one weight matrix (each channel) sliding continuously with a specific stride until the end of the layer, called parameter sharing. More specifically, if all neurons in a single channel share the same weight matrix, then the forward pass of the convolution layer can be computed as the weighted sum of the input layer. The complexity per layer is O(k n d 2 ), where k is the kernel size of convolutions, n represents the length of the input, and d is the number of depth dimensions. 37 As an end-to-end model, AC voltage response is directly input to 1D CNN, and the feature extraction process is automatically carried out by the combination of convolution and pooling (also called subsampling) operations. The full connection layers realize the classification capability. Compared with traditional ML algorithms, the extra feature extraction step, such as dimension reduction, has been avoided. The purpose of the 1D CNN training is to learn a set of parameters Q that map the input X to output T (discrete value for the classification problem, continuous value for the regression problem) according to Equation 1: 38 where L represents the number of layers, and the l th convolutional layer can be expressed as f l ðX l À 1 jQ l Þ = hðW5X l À 1 + bÞ; Q = ½W; b; (Equation 2) where 5 is the convolution operation. X l À 1 is the 2D input of the convolution layer; one dimension is the number of channels (for AC voltage response, the number of channels is 1; for color images in computer vision research, the number of channels is 3). In the convolution operation, the number of filters corresponds to the number of channels, and the other dimension is the length of the signal. b is a bias vector, which is not required in batch normalization. hð,Þ denotes the activation function, which introduces the non-linear ability. The pooling (subsampling) layer usually follows the convolution layer to reduce the dimension of the feature maps and prevent overfitting; meaning pooling and max pooling are commonly used.
The full connection layer differs from the convolution layer in that the input and the weight matrix undergo matrix multiplication rather than sliding filtering. More specific details on the deduction of CNNs can be found in LeCun et al., 39 Krizhevsky et al., 40 and Wang et al. 41 Figure 2 shows the proposed 1D CNN structure for AC voltage response input in this research. It consists of two convolutional layers, two pooling layers, and three full connection layers (the final one accompanied by a SoftMax classifier). The configurations of feature extraction layers for different input sizes are listed in Table 1.

Article
The softmax function is used to calculate the probability distribution by the following expression: where x i is the output of the i th neuron at the final full connection layer, and K indicates the number of predicted categories. The cross-entropy loss function can be described as where pðxÞ is the target distribution and qðxÞ is the predicted distribution.

Diagnosis implementation
The last 15% of the sample dataset in different health states was taken chronologically as the test dataset. For instance, the first 255 samples in health states are used to build the training dataset, and the last 45 samples are taken as the test dataset.
Compared with the random selection of the test dataset, the dynamic change of the FC system can be accounted for by dividing the test dataset according to the time series (see Figure 3). As the failure continues, the characteristics of the test dataset will change compared with the training dataset. Therefore, the diagnostic accuracy can also reflect the adaptability of the proposed method. The network model is built using PyTorch 42 in Python 3.7 with an i7-8850H CPU. Suppose the unsampled AC voltage response is used as the input to the network, as shown in Figure 4B, after 350 steps (every four steps represents a completed training of the model using all training datasets) of network training. In that case, significant fluctuation still exists in the accuracy and loss, and the network does not converge. Besides, as illustrated in Figure 4A, the diagnostic accuracy is only 83.08% after 400 steps. The reason lies in the disparity between the input layer dimension and the number of training datasets discussed in detail earlier. After down-sampling the AC voltage response, the accuracy and calculation loss converge with training steps. The final diagnostic accuracy reached 88.46%. Compared with using the unsampled signal directly, the accuracy increased by 5.38%, and the reasoning time of the network is also reduced. When the random split method is adopted, the diagnostic accuracy rate increases to 96.15%. The low accuracy of the chronological split dataset reflects insufficient data covering a wide enough range of health states to predict all states with high accuracy. Due to the network's initialization and the training data's random partition, the diagnosis results may vary slightly. Figures 4C and 4D summarize the detailed prediction of the CNN model, where each row of the confusion matrix indicates the target class while each column represents the predicted class. For down-sampled input, three flooding samples were wrongly predicted to be in the normal state, and 12 normal samples were improperly recognized as flooding states. In comparison, 22 errors were found for the unsampled data.

Multi-sine perturbation
Though the benefits of using sequential AC perturbation as the diagnostic variable have been demonstrated above, the time scale for the required measurement (36 s) is too long for practical use in real-time onboard diagnostics in operating FC stacks in many cases. Obtaining the diagnosis signal can be shortened (from 36 s of sequential perturbation) by supposing multi-frequency signals simultaneously. The acquisition time will be determined only by the lowest excitation frequency. For instance, if the minimum excitation frequency is 1 Hz, then the duration of the excitation is 1 s. Figure 5 illustrates the formation of a multi-sine perturbation signal. The overall amplitude of the supposition of the signals needs to remain low, which can avoid affecting the normal operation of the FC stack.
Considering that the humidity condition of the test sample is different from that of the training sample, it is more consistent with the actual situation, and the humidity conditions corresponding to different health states in reality should be a range of values. In the multi-sinusoidal excitation test, we defined 60% G 5%, 90% G 5%, and 30% G 5% as normal, flooding, and dehydration states, respectively. Figures 6A-6C show the voltage changes in the sampling process under different health conditions. The output voltage of the normal water management state is higher, while the output voltage of the flooding and dehydration state is lower and in the same range. The output voltage alone cannot distinguish flooding from The amplitude of the multi-sine perturbation signal must be controlled at 5%-10% of the fuel cell operating current.

OPEN ACCESS
dehydration. Nafion 212 was used as the membrane in these experiments because of the lack of availability of the Gore membrane used in the previous experiments, but the remaining operation conditions were unchanged, as shown in Table S1.
The sample split remains unchanged, with 510 training samples and 90 test samples. The multi-sine voltage response was also observed to be different under different health conditions (see Figure 7), and the voltage response characteristics remain unchanged under the same health state. For the normal state, each voltage response has a higher amplitude in the middle and a lower amplitude toward the end of the test. For the voltage response of flooding and the dehydration state, the amplitude of the dehydration is higher than the flooding state at certain positions. It is worth noting that since the excitation signal is a synthesis of multi-sine waves, the amplitude magnitude relationship at a particular position has no specific physical significance compared with the AC voltage response excited in sequence, as in the previous section. Since the perturbation signals we use are consistent, we are concerned with the difference in voltage response under different health states.
As shown in Figure 8, the diagnostic accuracy of AC voltage response using the multi-sine excitation is 100% (compared with 88.46% in the sequential AC voltage perturbation case). Nevertheless, adding up the individual sine waves increases the amplitude of the total perturbation; how to reduce the amplitude and improve repeatability is a problem that must be solved to allow for a more rapid diagnosis of health states.
Two key advantages of the proposed methodology are that it overcomes the limitation that EIS can only be measured in steady state and avoids the calculation and time-consuming process of time-frequency conversion. It is, therefore, suitable for real-time monitoring of the health status of the FC system. For vehicular applications, due to the larger number of single cells, the difference in AC voltage response under different health states is more prominent, and so the robustness of diagnosis will also increase accordingly. Compared with other diagnostic signals in the literature, there is an explicable relationship between the AC voltage response and the stack health state, and the classification accuracy is 100% when combined with CNN for the water management fault diagnosis.
Furthermore, Lei et al. 43 proposed that multi-sensor signals could provide more reliable diagnostic performance and that the AC voltage response could be further fused with other diagnostic signals in future studies, leading to increased robustness in diagnosis and the potential to diagnose other health states not considered in this study, such as CO poisoning and reactant starvation.
The entire EIS spectra have been taken as the input to a Gaussian process model by Zhang et al. 44 to predict the remaining useful life and estimate the capacity of lithium-ion batteries. Their results indicate that the EIS-ML approach can be applied in battery management systems. However, as mentioned earlier, EIS is difficult to calculate and is time consuming, and the battery needs to be in a steady state during measurement. The non-linear frequency response analysis is also a practical approach to identifying the SoH of lithium-ion batteries. 45 However, time-frequency conversion is still necessary. Therefore, the AC voltage response method presented here can also substitute the EIS spectra input for battery applications and could increase diagnostic accuracy with the decreased time constant. Therefore, we anticipate that the method presented in our work could be applied to other electrochemical devices such as lithium-ion batteries and lead to advanced, widely adopted, non-invasive battery management systems.
This article proposes a diagnostic strategy for the PEMFC system based on AC voltage response and the 1D CNN. Under the same excitation signal, different health states correspond to different AC voltage responses. Compared with previous methods in the literature, the AC voltage response is used, for the first time, as the original signal for FC fault diagnosis, and it can reflect the internal health state of electrochemical power systems, i.e., FCs. Additionally, AC voltage response can be collected in an unsteady state system, considering the traditional EIS measurement has errors when the FC stack is unsteady (faulty state). Due to its parameter sharing property, the 1D CNN is used as a diagnostic model, directly processing high-dimensional AC voltage response signals. The diagnostic accuracy of the test data is 100% for multi-sine perturbation of only 1 s. As the FC system is operated over its lifespan, its characteristics will change accordingly, and so the long-term predictive capability after a few months of operation needs to be focused on in The voltage signal measured during perturbation includes two parts: multi-sine AC voltage response and DC output of the fuel cell.

ll OPEN ACCESS
future studies. For the first time, we present a rapid and robust diagnostic method for the health state of a FC stack that has application in the wider diagnosis of additional faults in the system and in other electrochemical devices (not explored here).
We predict that such a methodology could be widely adopted for rapid onboard diagnosis of electrochemical devices during operation, without the need for costly or invasive sensing probes.

EXPERIMENTAL PROCEDURES
Resource availability Lead contact Further information and requests for resources should be directed to and will be fulfilled by the lead contact, Rhodri Jervis (rhodri.jervis@ucl.ac.uk).

Materials availability
No unique reagents were generated by this study.

Data and code availability
Experimental data generated during the study are available in the Mendeley Data repository at https://doi.org/10.17632/yhg3ks3jzc.1, and the code is available from GitHub link at https://github.com/Shangwei-ZHOU/Fuel_Cell_Diagnosis.git.