An Explainable Fault Diagnosis Algorithm for Proton Exchange Membrane Fuel Cells Integrating Gramian Angular Fields and Gradient-Weighted Class Activation Mapping
Abstract
1. Introduction
- (1)
- A new GAF-CNN algorithm is proposed, which can convert 1D time-series signals into two-dimensional GAF images without manual feature extraction and reliance on prior knowledge.
- (2)
- To solve the problem of model interpretability, we integrate the Grad-CAM technology to visualize the working principle and decision-making process of the neural network in the fault classification model. Given our GAF-based image classification approach, Grad-CAM is the most suitable method for providing visual localization to validate that the CNN is focusing on relevant spatiotemporal patterns within the 2D image.
- (3)
- The proposed algorithm is systematically validated using experimental data for critical fault types, including membrane drying and hydrogen leakage, demonstrating its superior diagnostic accuracy and interpretability compared to other baseline methods.
2. Fuel Cell System and Failure Types
2.1. Fuel Cell System
2.2. Failure Types
2.2.1. Hydrogen Leakage
2.2.2. Membrane Drying
3. The Proposed GAF-CNN and Grad-CAM Algorithm
3.1. Overview of the Proposed Algorithm
3.2. Gramian Angular Field
3.3. Convolutional Neural Network
3.4. Gradient-Weighted Class Activation Mapping
3.5. Fault Diagnosis of EC Fuel Cell System Based on GAF-CNN and Grad-CAM
- (1)
- Time-series data under three health states (normal, hydrogen leakage, and membrane drying) were collected from a 100 kW EC-PEMFC system using 20 sensors, standardized.
- (2)
- The 1D signals were converted into 2D GASF images using the GAF method to preserve temporal dependencies, and split into training and testing sets.
- (3)
- A CNN model was trained on GASF images to automatically extract features and classify system health states.
- (4)
- Model performance was evaluated on the test set to accurately identify fault types.
- (5)
- Grad-CAM was applied to generate class activation maps highlighting the key regions influencing model decisions.
- (6)
- Heatmaps were overlaid on the original GASF images to visually interpret diagnostic outcomes and enhance model transparency.
4. Results and Discussion
4.1. Evaluation Indicators
4.2. Diagnostic Results and Discussion
4.3. Analysis Using Grad-Cam
5. Conclusions
- (1)
- The GAF-CNN model achieved a 99.8% accuracy on the test set, outperforming baseline models like SVM, LSTM, and 1D CNN (with accuracies of 95.8%, 91.2%, and 97.4%, respectively), showing clear advantages in classifying (i.e., identifying and isolating) normal, hydrogen leakage, and membrane drying states. Evaluation metrics (precision, recall, F1-score) were all above 98.7%, demonstrating strong classification ability and robustness.
- (2)
- By introducing Grad-CAM technology, this study successfully solved the “black box” problem of deep learning models. The generated visual heatmap, as demonstrated in the analysis in Section 4.3 (Figure 7 and Figure 8), can clearly reveal the key data feature areas on which the model makes specific diagnoses (such as hydrogen leaks or membrane drying). This not only verifies the rationality of the model’s decisions but also provides deep insights into the underlying mechanisms of failure. In addition, the analysis of misclassified samples also intuitively shows why the model fails to effectively capture discriminative features in specific cases, pointing out the direction for further optimization of the model.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Belaïd, F.; Al-Sarihi, A.; Al-Mestneer, R. Balancing climate mitigation and energy security goals amid converging global energy crises: The role of green investments. Renew. Energy 2023, 205, 534–542. [Google Scholar] [CrossRef]
- Harichandan, S.; Kar, S.K.; Bansal, R.; Mishra, S.K. Achieving sustainable development goals through adoption of hydrogen fuel cell vehicles in India: An empirical analysis. Int. J. Hydrogen Energy 2023, 48, 4845–4859. [Google Scholar] [CrossRef]
- Rao, A.; Kumar, S.; Karim, S. Accelerating renewables: Unveiling the role of green energy markets. Appl. Energy 2024, 366, 123286. [Google Scholar] [CrossRef]
- Li, Q.; Wang, H.; Wang, T.; Li, X.; Liu, Y.; Chen, W.; You, Z. Online diagnosis method of water management faults based on hybrid-frequency electrochemical impedance spectroscopy for PEMFC. IEEE Trans. Transp. Electrif. 2024, 11, 2707–2716. [Google Scholar] [CrossRef]
- Wei, Z.; Shi, H.; Dong, Z.; Zhang, C.; He, H. Water Failure Diagnosis of PEMFC in Actual Operating Conditions with High-Frequency Impedance Features. IEEE Trans. Power Electron. 2024, 40, 7414–7422. [Google Scholar] [CrossRef]
- Abedin, T.; Pasupuleti, J.; Paw, J.K.S.; Tak, Y.C.; Mahmud, M.; Abdullah, M.P.; Nur-E-Alam, M. Proton exchange membrane fuel cells in electric vehicles: Innovations, challenges, and pathways to sustainability. J. Power Sources 2025, 640, 236769. [Google Scholar] [CrossRef]
- Jia, C.; Liu, W.; He, H.; Chau, K. Superior energy management for fuel cell vehicles guided by improved DDPG algorithm: Integrating driving intention speed prediction and health-aware control. Appl. Energy 2025, 394, 126195. [Google Scholar] [CrossRef]
- Jia, C.; Liu, W.; He, H.; Chau, K.-T. Health-conscious energy management for fuel cell vehicles: An integrated thermal management strategy for cabin and energy source systems. Energy 2025, 333, 137330. [Google Scholar] [CrossRef]
- Lu, D.; Hu, D.; Wang, J.; Wei, W.; Zhang, X. A data-driven vehicle speed prediction transfer learning method with improved adaptability across working conditions for intelligent fuel cell vehicle. IEEE Trans. Intell. Transp. Syst. 2025, 26, 10881–10891. [Google Scholar] [CrossRef]
- Lu, D.; Yi, F.; Hu, D.; Li, J.; Yang, Q.; Wang, J. Online optimization of energy management strategy for FCV control parameters considering dual power source lifespan decay synergy. Appl. Energy 2023, 348, 121516. [Google Scholar] [CrossRef]
- Guo, Z.; Ma, R.; Ma, H.; Li, Z.; Xiong, P.; Jiang, W.; Zhou, Y. An Online Fault Diagnosis Method for PEMFC Based on Output Voltage and Transfer Convolutional Neural Network. IEEE Trans. Ind. Electron. 2025, 72, 8039–8048. [Google Scholar] [CrossRef]
- Yue, M.; Zhang, X.; Teng, T.; Meng, J.; Pahon, E. Recursive performance prediction of automotive fuel cell based on conditional time series forecasting with convolutional neural network. Int. J. Hydrogen Energy 2024, 56, 248–258. [Google Scholar] [CrossRef]
- Zhang, C.; Zhang, Y.; Wang, L.; Deng, X.; Liu, Y.; Zhang, J. A health management review of proton exchange membrane fuel cell for electric vehicles: Failure mechanisms, diagnosis techniques and mitigation measures. Renew. Sustain. Energy Rev. 2023, 182, 113369. [Google Scholar] [CrossRef]
- Ma, T.; Zhang, Z.; Lin, W.; Yang, Y.; Yao, N. A review on water fault diagnosis of a proton exchange membrane fuel cell system. J. Electrochem. Energy Convers. Storage 2021, 18, 030801. [Google Scholar] [CrossRef]
- Xing, Y.; Wang, B.; Gong, Z.; Hou, Z.; Xi, F.; Mou, G.; Du, Q.; Gao, F.; Jiao, K. Data-driven fault diagnosis for PEM fuel cell system using sensor pre-selection method and artificial neural network model. IEEE Trans. Energy Convers. 2022, 37, 1589–1599. [Google Scholar] [CrossRef]
- Tian, J.; Xiong, R.; Shen, W.; Lu, J. Data-driven battery degradation prediction: Forecasting voltage-capacity curves using one-cycle data. EcoMat 2022, 4, e12213. [Google Scholar] [CrossRef]
- Quan, R.; Liang, W.; Wang, J.; Li, X.; Chang, Y. An enhanced fault diagnosis method for fuel cell system using a kernel extreme learning machine optimized with improved sparrow search algorithm. Int. J. Hydrogen Energy 2024, 50, 1184–1196. [Google Scholar] [CrossRef]
- Hu, J.; Bian, X.; Wei, Z.; Li, J.; He, H. Residual statistics-based current sensor fault diagnosis for smart battery management. IEEE J. Emerg. Sel. Top. Power Electron. 2021, 10, 2435–2444. [Google Scholar] [CrossRef]
- Esmaili, Q.; Nimvari, M.E.; Jouybari, N.F.; Chen, Y.-S. Model based water management diagnosis in polymer electrolyte membrane fuel cell. Int. J. Hydrogen Energy 2020, 45, 15618–15629. [Google Scholar] [CrossRef]
- Lee, W.-Y.; Oh, H.; Kim, M.; Choi, Y.-Y.; Sohn, Y.-J.; Kim, S.-G. Hierarchical fault diagnostic method for a polymer electrolyte fuel cell system. Int. J. Hydrogen Energy 2020, 45, 25733–25746. [Google Scholar] [CrossRef]
- Yang, D.; Wang, Y.; Chen, Z. Robust fault diagnosis and fault tolerant control for PEMFC system based on an augmented LPV observer. Int. J. Hydrogen Energy 2020, 45, 13508–13522. [Google Scholar] [CrossRef]
- Karyofylli, V.; Danner, Y.; Raman, K.A.; Kungl, H.; Karl, A.; Jodat, E.; Eichel, R.-A. Sensitivity analysis and uncertainty quantification in predictive modeling of proton-exchange membrane electrolytic cells. J. Power Sources 2024, 600, 234209. [Google Scholar] [CrossRef]
- Li, K.; Hong, J.; Zhang, C.; Liang, F.; Yang, H.; Ma, F.; Wang, F. Health state monitoring and predicting of proton exchange membrane fuel cells: A review. J. Power Sources 2024, 612, 234828. [Google Scholar] [CrossRef]
- Yi, F.; Sun, Y.; Zhang, J.; Zhou, J.; Zhang, C.; Yu, W.; Gong, H. Early flooding fault diagnosis method of fuel cell based on feature amplification transformer. Int. J. Hydrogen Energy 2025, 119, 13–24. [Google Scholar] [CrossRef]
- Wang, Z.; Gao, Y.; Yu, J.; Tian, L.; Yin, C. Data-driven fault diagnosis of PEMFC water management with segmented cell and deep learning technologies. Int. J. Hydrogen Energy 2024, 67, 715–727. [Google Scholar] [CrossRef]
- Chen, Y.; Zhang, J.; Zhai, S.; Hu, Z. Data-driven modeling and fault diagnosis for fuel cell vehicles using deep learning. Energy AI 2024, 16, 100345. [Google Scholar] [CrossRef]
- Han, F.; Tian, Y.; Zou, Q.; Zhang, X. Research on the fault diagnosis of a polymer electrolyte membrane fuel cell system. Energies 2020, 13, 2531. [Google Scholar] [CrossRef]
- Gu, X.; Hou, Z.; Cai, J. Data-based flooding fault diagnosis of proton exchange membrane fuel cell systems using LSTM networks. Energy AI 2021, 4, 100056. [Google Scholar] [CrossRef]
- Deng, X.; Ren, Y.; Zhao, Z.; Lian, H.; Du, D. Fault diagnosis of proton exchange membrane fuel cells based on CNN neural network. In Proceedings of the 2023 CAA Symposium on Fault Detection, Supervision and Safety for Technical Processes (SAFEPROCESS), Yibin, China, 22–24 September 2023; IEEE: New York, NY, USA, 2023; pp. 1–6. [Google Scholar]
- Mahesh, T.; Chandrasekaran, S.; Ram, V.A.; Kumar, V.V.; Vivek, V.; Guluwadi, S. Data-driven intelligent condition adaptation of feature extraction for bearing fault detection using deep responsible active learning. IEEE Access 2024, 12, 45381–45397. [Google Scholar] [CrossRef]
- Cao, F.; Tang, Z.; Zhu, C.; He, X. Data-driven hierarchical collaborative optimization method with multi-fidelity modeling for aerodynamic optimization. Aerosp. Sci. Technol. 2024, 150, 109206. [Google Scholar] [CrossRef]
- Chen, X.; Jin, X.; Huang, Z. Stability and reliability analysis of nonlinear stochastic system using data-driven dimensional analysis method. Mech. Syst. Signal Process. 2024, 212, 111299. [Google Scholar] [CrossRef]
- Mao, L.; Jackson, L.; Dunnett, S. Fault diagnosis of practical polymer electrolyte membrane (PEM) fuel cell system with data-driven approaches. Fuel Cells 2017, 17, 247–258. [Google Scholar] [CrossRef]
- Hong, J.; Yang, J.; Weng, Z.; Ma, F.; Liang, F.; Zhang, C. Review on proton exchange membrane fuel cells: Safety analysis and fault diagnosis. J. Power Sources 2024, 617, 235118. [Google Scholar] [CrossRef]
- Xu, L.; Xu, L.; Shao, Y.; Zhang, X.; Hu, Z.; Li, J.; Ouyang, M. Effects of hydrogen dilution on performance and in-plane uniformity of large-scale PEM fuel cell with low anode catalyst loading. Appl. Energy 2025, 379, 124992. [Google Scholar] [CrossRef]
- Lei, J.; Wang, Z.; Zhang, Y.; Ju, M.; Fei, H.; Wang, S.; Fu, C.; Yuan, X.; Fu, Q.; Farid, M.U.; et al. Understanding and resolving the heterogeneous degradation of anion exchange membrane water electrolysis for large-scale hydrogen production. Carbon Neutrality 2024, 3, 25. [Google Scholar] [CrossRef]
- Zhao, H.; Li, W.; Wang, X.; Liu, M.; Zhang, C. Safety analysis of a hydrogen-electric coupling system in confined space. Int. J. Hydrogen Energy 2025, 119, 294–308. [Google Scholar] [CrossRef]
- Arun, M.; Giddey, S.; Joseph, P.; Dhawale, D.S. Challenges and mitigation strategies for general failure and degradation in polymer electrolyte membrane-based fuel cells and electrolysers. J. Mater. Chem. A 2025, 13, 11236–11263. [Google Scholar] [CrossRef]
- Vandenberghe, F.; Micoud, F.; Schott, P.; Morin, A.; Lafforgue, C.; Chatenet, M. Low-loaded catalyst layers for proton exchange membrane fuel cell dynamic operation part 1: Experimental study. Electrochim. Acta 2025, 511, 145364. [Google Scholar] [CrossRef]
- Niu, M.; Gao, Y.; Pan, Q.; Zhang, T. Review on factors of voltage consistency and inconsistent degradation in proton exchange membrane fuel cells. Ionics 2024, 30, 2433–2458. [Google Scholar] [CrossRef]
- Ma, M.; Shen, L.; Zhao, Z.; Guo, P.; Liu, J.; Xu, B.; Zhang, Z.; Zhang, Y.; Zhao, L.; Wang, Z. Activation methods and underlying performance boosting mechanisms within fuel cell catalyst layer. eScience 2024, 4, 100254. [Google Scholar] [CrossRef]








| Variables | Unit | Variables | Unit |
|---|---|---|---|
| Anode Exhaust Pressure #1 | mbar | Cathode stoichiometry | N/A |
| Anode Exhaust Pressure #2 | mbar | Cathode Exhaust Temperature #2 | °C |
| Cathode Exhaust Pressure #1 | mbar | Cathode supply Temperature #2 | °C |
| Cathode Exhaust Pressure #2 | mbar | Cathode Exhaust Temperature #1 | °C |
| Current | A | Cathode supply Temperature #1 | °C |
| Anode reactant flow | SLPM | Coolant supply temperature | °C |
| Anode supply pressure #1 | mbar | Coolant supply pressure #1 | mbar |
| Anode supply pressure #2 | mbar | Coolant supply pressure #2 | mbar |
| Air inlet flow | SLPM | Coolant flow supply #1 | SLPM |
| Cathode supply Pressure #1 | mbar | Coolant flow supply #2 | SLPM |
| Health State | Label | Sample Number (For Training) | Sample Number (For Testing) |
|---|---|---|---|
| Normal state | 0 | 660 | 440 |
| Hydrogen leakage | 1 | 660 | 440 |
| Membrane drying | 2 | 660 | 440 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Shu, X.; Yi, F.; Zhang, J.; Zhou, J.; Wang, S.; Gong, H.; Wang, S. An Explainable Fault Diagnosis Algorithm for Proton Exchange Membrane Fuel Cells Integrating Gramian Angular Fields and Gradient-Weighted Class Activation Mapping. Electronics 2025, 14, 4401. https://doi.org/10.3390/electronics14224401
Shu X, Yi F, Zhang J, Zhou J, Wang S, Gong H, Wang S. An Explainable Fault Diagnosis Algorithm for Proton Exchange Membrane Fuel Cells Integrating Gramian Angular Fields and Gradient-Weighted Class Activation Mapping. Electronics. 2025; 14(22):4401. https://doi.org/10.3390/electronics14224401
Chicago/Turabian StyleShu, Xing, Fengyan Yi, Jinming Zhang, Jiaming Zhou, Shuo Wang, Hongtao Gong, and Shuaihua Wang. 2025. "An Explainable Fault Diagnosis Algorithm for Proton Exchange Membrane Fuel Cells Integrating Gramian Angular Fields and Gradient-Weighted Class Activation Mapping" Electronics 14, no. 22: 4401. https://doi.org/10.3390/electronics14224401
APA StyleShu, X., Yi, F., Zhang, J., Zhou, J., Wang, S., Gong, H., & Wang, S. (2025). An Explainable Fault Diagnosis Algorithm for Proton Exchange Membrane Fuel Cells Integrating Gramian Angular Fields and Gradient-Weighted Class Activation Mapping. Electronics, 14(22), 4401. https://doi.org/10.3390/electronics14224401

