Method for analyzing liquid water in fuel cell based on convolutional neural network
By employing a deep learning method based on convolutional neural networks, combined with the YOLOv8 model and a small target detection head, the problem of low accuracy in liquid water identification in proton exchange membrane fuel cells was solved, achieving high-precision automatic identification and quantitative analysis of liquid water, and improving the water management performance of fuel cells.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-05
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies struggle to accurately and automatically identify liquid water within the flow channels of proton exchange membrane fuel cells, especially small droplets and membrane characteristics. Furthermore, they lack quantifiable indicators of liquid water behavior, which impacts fuel cell performance and lifespan.
By employing a deep learning method based on convolutional neural networks, combined with the YOLOv8 model and a small target detection head, and through data augmentation and model optimization, automatic identification and feature analysis of liquid water are achieved, including image preprocessing, flow pattern classification, and liquid water coverage calculation.
It achieves high-throughput and high-precision identification of liquid water, can quickly process large batches of images and provide accurate quantitative results, assists in the structural optimization and operation control of fuel cells, and improves the water management performance of fuel cells.
Smart Images

Figure CN121811218A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of new energy technology, specifically relating to a method for identifying and analyzing the characteristics of liquid water in the flow channel of a proton exchange membrane fuel cell based on a convolutional neural network calculation method. This method enables rapid identification, quantitative analysis, and water management performance evaluation of liquid water distribution, flow pattern, and liquid water coverage during fuel cell operation. Background Technology
[0002] Proton exchange membrane fuel cells (PEMFCs) are widely used in transportation and energy storage due to their advantages such as high energy density, low operating temperature, and zero emissions. However, water management within the fuel cell remains a key factor limiting its performance and lifespan. Excessive water in the membrane electrode assembly (MEA) can cause liquid accumulation in the flow channels, obstructed gas transport, and voltage fluctuations; while insufficient water can lead to membrane dehydration and increased impedance (CN116289319B). Visualization methods mainly include neutron imaging, X-ray imaging, nuclear magnetic resonance (NMR), and optical observation, but these methods have the following drawbacks: high cost, complex systems, and difficulty in long-term use under conventional experimental conditions; image processing relies heavily on manual judgment, resulting in strong subjectivity and poor repeatability; and there is a lack of quantifiable and reproducible indicators of liquid water behavior.
[0003] In recent years, with the advancement of neural network computing methods, deep learning has demonstrated high accuracy and high throughput in the field of image recognition, and has been widely used in PEMFC defect identification and detection (CN120084400B) (CN117870778A). However, its application in PEMFC flow channel liquid water identification has significant technical limitations, especially in the identification of low-contrast features such as small droplets and thin films, where traditional networks are prone to missing detections.
[0004] Therefore, there is an urgent need for a method that combines experimental visualization with deep learning recognition algorithms to achieve automatic detection, flow pattern classification and quantitative characterization of liquid water in the flow channel, so as to provide efficient support for the structural optimization and operation control of fuel cells. Summary of the Invention
[0005] The purpose of this invention is to provide a method for liquid water identification and feature analysis in PEMFC channels based on convolutional neural network deep learning, in order to solve the problems of low identification accuracy, strong reliance on manual intervention, and difficulty in quantitative analysis in traditional visualization analysis. This method enables automatic identification of liquid water transport behavior, flow pattern classification, and quantitative calculation of liquid water coverage, and reveals the influence of different gas diffusion layer (GDL) structures on water management performance.
[0006] To achieve the above objectives, the present invention provides a method for identifying and analyzing liquid water inside a PEMFC channel based on a convolutional neural network, comprising the following steps:
[0007] (1) Experimentally acquire and preprocess images of liquid water in the flow channel;
[0008] (2) Establish a liquid water identification model based on YOLOv8 and including a small target detection head;
[0009] (3) Data augmentation is performed using the image processing capabilities of an open-source computer vision library;
[0010] (4) Train and optimize model parameters;
[0011] (5) Set different thresholds to classify flow patterns and calculate liquid water coverage. Based on an open-source computer vision library, label different flow patterns.
[0012] (6) Compare the liquid water coverage and flow pattern distribution under different membrane electrode structures.
[0013] Furthermore,
[0014] The YOLOv8 model consists of three parts: a backbone network, a neck, and a head. A new detection branch is added between the head and neck to detect small droplet targets larger than 4×4 pixels. A matching feature fusion module is then added to the neck.
[0015] The data augmentation in step (3) includes mosaic, rotation, cropping and random flipping operations to improve the model's generalization ability.
[0016] Step (4) involves training and optimizing the model parameters by using pre-trained weights and employing early stopping to prevent overfitting. During optimization, a stochastic gradient descent optimizer with linear annealing scheduling is used to gradually reduce the learning rate from the initial value to the final value.
[0017] The flow patterns in step (5) are divided into droplets, films and slugs. The flow pattern classification is based on the area of the detection area being less than, between or greater than the set threshold, respectively.
[0018] The formula for calculating the liquid water coverage rate in step (6) is:
[0019] (1)
[0020] The results of liquid water coverage and flow pattern distribution can assist in the comprehensive analysis of heat and mass transfer in fuel cells, as well as the distribution characteristics of electrochemical reactions, through polarization curves and electrochemical impedance spectroscopy. This can be used to verify the performance improvement effects of different membrane electrode or flow field structures in proton exchange membrane fuel cells.
[0021] The features and effects of this invention are as follows:
[0022] (1) High throughput and high precision recognition: Real-time detection of droplets and thin films is achieved through image recognition models, significantly improving recognition speed and accuracy.
[0023] (2) Strong objectivity and scalability: It replaces manual analysis and realizes automatic flow pattern determination and time series analysis. Compared with traditional manual analysis, this method can complete the processing and analysis of large batches of data in a very short time. It usually only takes a few seconds to a few minutes to process thousands of images and can also provide accurate quantitative results.
[0024] (3) High engineering applicability: The model is simple to deploy and use, consumes few resources, and is compatible with different fuel cell experimental platforms.
[0025] (4) Provide data support for fuel cell component structure design: reveal the liquid water distribution characteristics under different component structures, improve drainage performance, and provide a basis for fuel cell design optimization. Attached Figure Description
[0026] Figure 1 This is a flowchart of the overall method in this invention.
[0027] Figure 2 This is the optimized YOLOv8 network structure diagram in this invention.
[0028] Figure 3a This is a comparison chart of the F1 curves before and after adding the P2 detector head to the model in this invention.
[0029] Figure 3b This is a comparison chart of the Precision curves before and after adding the P2 detection head to the model in this invention.
[0030] Figure 3c This is a comparison chart of Recall curves before and after adding the P2 detector head to the model in this invention.
[0031] Figure 3d This is a comparison chart of the Precision-Recall curves before and after adding the P2 detection head to the model in this invention.
[0032] Figure 4 This is a trend diagram of liquid water coverage distribution in an embodiment of the present invention.
[0033] Figure 5 This is a flow pattern coverage distribution trend diagram in an embodiment of the present invention. Detailed Implementation
[0034] The design scheme of the method of the present invention will be described in detail below with reference to the accompanying drawings and examples. It should be noted that this embodiment is descriptive and not limiting, and is not intended to limit the scope of protection of the present invention.
[0035] The method for analyzing liquid water inside a fuel cell based on convolutional neural networks includes the following steps:
[0036] (1) Experimentally acquire and preprocess images of liquid water in the flow channel;
[0037] (2) Establish a liquid water identification model based on YOLOv8 and including a small target detection head;
[0038] (3) Data augmentation based on open-source computer vision libraries and their image processing capabilities.
[0039] (4) Train and optimize model parameters;
[0040] (5) Set different thresholds to classify flow patterns and calculate liquid water coverage. Based on an open-source computer vision library, label different flow patterns.
[0041] (6) Compare the liquid water coverage and flow pattern distribution under different membrane electrode structures.
[0042] Step (1) Use a high-speed camera to acquire flow channel images and extract image sequences within 10 seconds or even 10 minutes as analysis samples.
[0043] In step (2), the YOLOv8 model consists of three parts: a backbone network (Backbone, Neck, and Head), a neck, and a head. A new detection branch is added between the head to detect small droplet targets larger than 4×4 pixels, and a matching feature fusion module is added to the neck.
[0044] The data augmentation in step (3) includes mosaic, rotation, cropping and random flipping operations to improve the model's generalization ability.
[0045] Step (4) involves training and optimizing the model parameters by using pre-trained weights and employing early stopping to prevent overfitting. During optimization, a stochastic gradient descent (SGD) optimizer with linear annealing scheduling is used to gradually reduce the learning rate from the initial value to the final value.
[0046] The momentum parameter is typically set between 0.9 and 0.95 to accelerate convergence, and weight decay is used during optimization to prevent overfitting. Furthermore, to improve stability in the early stages of training, a warm-up strategy is employed for the first 3 to 5 rounds, with a warm-up momentum between 0.8 and 0.9 and a bias learning rate typically set between 0.1 and 0.2.
[0047] To improve the model's performance in various classification tasks, the localization loss weight in the loss function was set to 0.5 to 0.7, the classification loss weight to 0.4 to 0.6, and the distribution loss weight to 1.0 to 2.0.
[0048] The flow patterns in step (5) are divided into droplets, films, and slugs. The flow pattern classification is based on the area of the detection region being less than, between, or greater than the set threshold, respectively.
[0049] The formula for calculating liquid water coverage (LWC) in step (6) is as follows:
[0050] (1)
[0051] Among them, A water Let A be the surface area of the liquid water within the flow channel. channel This represents the total area of the flow channel.
[0052] The results of liquid water coverage and flow pattern distribution can assist in the comprehensive analysis of heat and mass transfer in fuel cells, as well as the distribution characteristics of electrochemical reactions, through polarization curves and electrochemical impedance spectroscopy. This can be used to verify the performance improvement effects of different membrane electrode or flow field structures in proton exchange membrane fuel cells.
[0053] Example steps:
[0054] (1) Construction of a transparent fuel cell visualization experimental system: An experimental platform consisting of an air flow controller, a water injection pump, a perforated flow field plate, a transparent end plate, and a high-speed camera was built. The high-speed camera acquired dynamic images of liquid water in the flow channel at 100 frames per second, the battery temperature was maintained at 70°C, and the relative humidity was controlled at 100%. The system can realize single-hole or multi-hole water injection mode to simulate the water generation process under different working conditions.
[0055] (2) Acquisition of experimental images: Real-time image acquisition was carried out using a high-speed camera to ensure that the rapid changes of liquid water in the flow channel could be captured. Finally, by designing different numbers and positions of water injection points, the real liquid water generation process under different working conditions was simulated, and liquid water distribution image sequences under different experimental conditions were obtained respectively.
[0056] (3) Image preprocessing: The acquired raw images are converted to grayscale, denoised, and have their background subtracted. 10 seconds (1000 frames) of samples are extracted for each experiment as analysis data. This step ensures stable input image quality and enhanced contrast, facilitating subsequent feature detection.
[0057] (4) Constructing a liquid water identification model based on YOLOv8: Using the YOLOv8 network as the basic framework, in order to improve the detection sensitivity of small droplets and thin films, this embodiment introduces a new high-resolution P2 detection branch (160×160 feature map) in the YOLOv8 network structure to achieve accurate detection of small droplets larger than 4×4 pixels.
[0058] (4) Model Training and Hyperparameter Optimization: 200 high-quality samples were selected from the experimental images as the training set, and data augmentation operations (Mosaic stitching, rotation, cropping, and flipping) were performed on them. During training, the hyperparameters were adjusted based on the model's performance on the validation set to ensure the accuracy of the liquid water prediction results. The setting and adjustment of hyperparameters can effectively ensure the convergence, accuracy, and generalization ability of the model during the training process. The final model training results are shown in Figure 3. After adding the P2 branch, the average precision (mAP) increased by about 44.5%, and the false negative rate decreased by 14%.
[0059] (5) Flow pattern classification and liquid water coverage calculation based on OpenCV. The flow pattern classification threshold is set according to the area of the detection box to automatically distinguish three types of flow patterns: Droplet, Film and Slug.
[0060] Using the formula:
[0061]
[0062] Calculate the liquid water coverage for each frame and obtain the 10-second time series liquid water coverage curve and flow pattern classification curve. Specific Implementation
[0063] This embodiment takes the distribution patterns and characteristics of liquid water in perforated GDL (Gas diffusion layer) and ordinary GDL channels as the analysis object, and elaborates in detail the complete execution flow of the liquid water identification and feature analysis method in PEMFC channels based on convolutional neural networks, including data acquisition, image preprocessing, model optimization and training, liquid water classification and liquid water coverage calculation, etc. (e.g.) Figure 1 (As shown).
[0064] (1) Design and data acquisition of transparent fuel cell experimental device
[0065] In this embodiment, a transparent fuel cell experimental device was first designed and constructed. This device includes a feedwater end plate, a water injection orifice plate, a perforated flow channel structure, and a transparent observation window, enabling real-time observation of the distribution and transport behavior of liquid water within the flow channel. To acquire high-quality image data, a high-speed camera was used, with parameters set to 1024×1024 pixels, 100 fps, and a shutter speed of 1 / 10000 second. Through experimental setup, image data was collected under different GDL configurations, including the liquid water distribution in perforated GDLs and ordinary GDLs.
[0066] (2) Image preprocessing and dataset construction
[0067] After image data acquisition, OpenCV was used for image preprocessing. First, denoising was performed using Gaussian Blur to smooth the image, reducing noise and improving image clarity. Then, image contrast was enhanced using histogram equalization to make the edges of liquid water regions more prominent, increasing the visibility of liquid water in the image. Next, local cropping was performed to focus on observing the distribution areas of liquid water in the flow channel. The processed image sequence was used to construct a training dataset, consisting of 200 qualified images.
[0068] (3) Data augmentation and expansion
[0069] To improve the generalization ability of deep learning models, this embodiment expands the training dataset using data augmentation methods. The specific augmentation methods and parameters are as follows:
[0070] Rotation: Randomly rotate the image within a range of ±30° to enhance the model's ability to recognize liquid water images from different angles.
[0071] Translation: Randomly translate the image, with the image size shifted by ±10% in both the horizontal and vertical directions, to simulate the distribution of liquid water at different locations.
[0072] Cropping: Randomly crop 70% to 90% of the image area from the original image to ensure that the model can adapt to liquid water areas of different sizes.
[0073] Mosaic: Stitches together four randomly selected images with a stitching value of 1.0 to increase the detection capability of small droplets.
[0074] Brightness Adjustment: Randomly adjusts the brightness of the image, ranging from 0.7 to 1.3, to simulate image changes under different lighting conditions.
[0075] Contrast Adjustment: Randomly adjusts the image contrast between 0.7 and 1.3 to simulate different environmental conditions.
[0076] These enhancement methods generated a total of 4,000 images based on the original dataset, greatly improving the model's adaptability to different liquid water distributions and lighting conditions.
[0077] (4) Construction of YOLOv8 deep learning model
[0078] In this embodiment, the YOLOv8 deep learning model is used for automatic identification and classification of liquid water. The YOLOv8 network effectively identifies and classifies different flow patterns such as droplets, films, and slugs through its multi-scale detection heads (including P2, P3, P4, and P5). To improve the detection sensitivity for small droplets and films, a P2 detection head is added to the YOLOv8 network, using a 160×160 pixel feature map to improve the detection accuracy of small targets (e.g.,...). Figure 2 (As shown).
[0079] (5) The following hyperparameter tuning strategies were used during the training of the YOLOv8 network:
[0080] Learning Rate: The initial learning rate is set to 0.01. A linear annealing strategy is used to gradually reduce the learning rate to ensure smooth convergence of the model. The learning rate gradually decreases from 0.01 to 0.001.
[0081] Momentum: Set the momentum to 0.937 to accelerate gradient descent and stabilize the optimization process.
[0082] Weight Decay: To prevent overfitting, the weight decay is set to 5 × 10. -4 Penalizing large weight values helps the model learn more effective features.
[0083] Batch Size: Set the batch size to 16 to balance computing resources and training speed.
[0084] Training epochs: The training epochs are set to 600 epochs, and an early stopping policy (patience=100) is used, that is, if the accuracy on the validation set does not improve within 100 epochs, training is stopped.
[0085] Optimizer: Uses a stochastic gradient descent (SGD) optimizer, which updates the model weights based on the gradient of the loss function.
[0086] These hyperparameter settings and adjustments ensured convergence, accuracy, and generalization ability of the model during training. The final model training results are shown in Figure 3.
[0087] (6) Classification of liquid water flow patterns and calculation of liquid water coverage
[0088] Liquid water regions in the images were identified and classified using the YOLOv8 network, determining three main flow regimes: droplets, thin films, and slug flows. Based on this, the liquid water coverage was calculated by determining the area of each flow regime. Liquid water coverage is defined as the proportion of the liquid water region to the total flow channel area. To analyze the temporal variation of liquid water, the liquid water coverage was collected for each frame of the image, and a time-dependent variation curve was generated to further analyze the distribution and dynamic evolution of liquid water in the flow channel.
[0089] (7) Analysis of the impact of liquid water flow pattern on performance
[0090] Under different GDL configurations, this embodiment focuses on liquid water coverage ( Figure 4 ) and liquid water flow type ( Figure 5 The impact of perforated GDL configuration on PEMFC performance was quantitatively analyzed. With the perforated GDL configuration, liquid water accumulation was effectively suppressed, liquid water coverage fluctuations were smaller, and liquid water removal efficiency was higher. This result indicates that the perforated GDL configuration has significant advantages in water management, contributing to improved PEMFC stability and performance. Conversely, with the conventional GDL configuration, liquid water accumulation and liquid water coverage fluctuations were larger, leading to higher voltage drop fluctuations and poorer battery performance.
[0091] This embodiment successfully achieves automatic identification and classification of liquid water in PEMFC flow channels by combining a transparent fuel cell experimental setup and a YOLOv8 deep learning model. Through calculation and analysis of liquid water coverage and flow pattern, the impact of different GDL configurations on liquid water management and PEMFC performance is revealed. Experimental results show that the perforated GDL configuration can effectively reduce liquid water accumulation, minimize liquid water coverage fluctuations, optimize water management, and improve the stability and performance of PEMFCs.
[0092] This invention proposes a method for identifying and analyzing liquid water in PEMFC flow channels. By designing a transparent fuel cell experimental setup and combining it with a high-speed camera, dynamic image data of liquid water in the flow channels is acquired. Through optimization of the YOLOv8 deep learning model, accurate automatic identification and classification of liquid water is achieved, successfully identifying different flow regimes (droplets, thin films, slug flow) and calculating the liquid water coverage. Data augmentation techniques are used to expand the training set, enabling high-speed processing and analysis of thousands of images per minute, improving the model's generalization ability. Experimental results show that, compared to ordinary GDLs, perforated gas diffusion layers (GDLs) can effectively reduce liquid water accumulation, decrease liquid water coverage fluctuations, and improve the water management efficiency and stability of PEMFCs. This invention provides an efficient and scalable water management analysis method with broad application prospects, particularly in PEMFC performance optimization and design.
Claims
1. A method for analyzing liquid water inside a fuel cell based on convolutional neural networks, characterized in that: Liquid water analysis methods include the following steps: (1) Experimentally acquire and preprocess images of liquid water in the flow channel; (2) Establish a liquid water identification model based on YOLOv8 and including a small target detection head; (3) Data augmentation is performed using the image processing capabilities of an open-source computer vision library; (4) Train and optimize model parameters; (5) Set different thresholds to classify flow patterns and calculate liquid water coverage. Based on an open-source computer vision library, label different flow patterns. (6) Compare the liquid water coverage and flow pattern distribution under different membrane electrode structures.
2. The method for analyzing liquid water inside a fuel cell based on a convolutional neural network according to claim 1, characterized in that: The YOLOv8 model consists of three parts: a backbone network, a neck, and a head. A new detection branch is added between the head and neck to detect small droplet targets larger than 4×4 pixels. A matching feature fusion module is then added to the neck.
3. The method for analyzing liquid water inside a fuel cell based on a convolutional neural network according to claim 1, characterized in that: The data augmentation in step (3) includes mosaic, rotation, cropping and random flipping operations to improve the model's generalization ability.
4. The method for analyzing liquid water inside a fuel cell based on a convolutional neural network according to claim 1, characterized in that: The training and optimization of model parameters in step (4) includes: using pre-trained weights and employing early stopping to prevent overfitting; during the optimization process, using a stochastic gradient descent optimizer with linear annealing scheduling to gradually reduce the learning rate from the initial value to the final value; the momentum parameter is generally between 0.9 and 0.95 to accelerate convergence, and weight decay is used during the optimization process to prevent overfitting; to improve the stability in the early stage of training, a warm-up strategy is adopted for the first 3 to 5 rounds of training, where the warm-up momentum is between 0.8 and 0.9, and the bias learning rate is generally set to 0.1 to 0.2; to improve the performance of the model in various classification tasks, the localization loss weight in the loss function is set to 0.5 to 0.7; the classification loss weight is set to 0.4 to 0.6; and the distribution loss weight is set to 1.0 to 2.
0.
5. The method for analyzing liquid water inside a fuel cell based on a convolutional neural network according to claim 1, characterized in that: The flow patterns in step (5) are classified into droplets, films, and slugs. The flow pattern classification is based on the area of the detection region being less than, between, or greater than the set threshold, respectively.
6. The method for analyzing liquid water inside a fuel cell based on a convolutional neural network according to claim 1, characterized in that: The formula for calculating the liquid water coverage rate in step (6) is as follows: (1) Among them, A water Let A be the surface area of the liquid water within the flow channel. channel This represents the total area of the flow channel.
7. The method for analyzing liquid water inside a fuel cell based on a convolutional neural network according to claim 1, characterized in that: Step (1) involves using a high-speed camera to acquire channel images and extracting image sequences within 10 seconds or even 10 minutes as analysis samples.
8. The method for analyzing liquid water inside a fuel cell based on a convolutional neural network according to claim 1, characterized in that: The liquid water coverage and flow pattern distribution results can assist in the comprehensive analysis of heat and mass transfer in fuel cells using polarization curves and electrochemical impedance spectroscopy, as well as the distribution characteristics of electrochemical reactions, and can be used to verify the performance improvement effects of different membrane electrode or flow field structures in proton exchange membrane fuel cells.
Citation Information
Patent Citations
Preparation and processing method of carbon paper with ordered array pore structure
CN116289319B
Detection method and system for bipolar plate of fuel cell
CN117870778A
Detection System and Method for Hydrogen Fuel Cell Flow Guide Bipolar Plate
CN120084400B