Proton exchange membrane fuel cell fault diagnosis method and system based on improved YOLOv5
By improving the YOLOv5 model, combining EfficientViT, Gold-YOLO and ASF-YOLO networks, and combining random pruning and distillation algorithms, the YOLOv5-EGA_R_MGD model is obtained, which solves the accuracy and real-time diagnosis of proton exchange membrane fuel cell fault diagnosis in the prior art. Problem, achieving high accuracy and low latency fault diagnosis effect.
Patent Information
- Application Number
- CN202411457857.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-11
AI Technical Summary
The existing proton exchange membrane fuel cell fault diagnosis methods cannot accurately classify the locomotive system status, cannot guarantee stable operation, cannot reduce power loss and irreversible damage, and cannot achieve both offline and online fault diagnosis.
The improved YOLOv5 model was adopted to replace the original trunk part through the EfficientViT network, and the neck was improved using the Gold-YOLO and ASF-YOLO networks, and combined with the random pruning algorithm and the mask generation distillation algorithm, the YOLOv5-EGA_R_MGD model was obtained, which was used for proton exchange membrane fuel. Battery fault diagnosis.
It improves the accuracy of fault diagnosis, realizes the support of both offline and online fault diagnosis, with small model parameters and low latency, suitable for embedded device transplantation, and improves the fault diagnosis technology, reliability and durability of PEMFC system.
Smart Images

Figure CN119416085A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a proton exchange membrane fuel cell fault diagnosis method, and in particular to a proton exchange membrane fuel cell fault diagnosis method and system based on improved YOLOv5. Background Art
[0002] As an emerging clean energy technology, proton exchange membrane fuel cell (PEMFC) has the advantages of high efficiency, environmental protection, and low noise, and has become one of the most promising clean energy sources in recent years. However, fuel cell failure will lead to reduced reliability and poor durability, which is still the main problem restricting the development of fuel cell technology. Therefore, accurate and timely fault diagnosis is crucial to maintain the performance of PEMFC and extend its service life.
[0003] Existing fault diagnosis methods cannot accurately classify the status of the locomotive proton exchange membrane fuel cell system, cannot ensure the stable operation of the locomotive proton exchange membrane fuel cell system, cannot reduce the power loss caused by the fault, avoid the irreversible damage to the fuel cell system caused by the fault, and extend its healthy operation time.
[0004] At present, there are three main methods for PEMFC fault diagnosis: experimental test method, model-based method and data-driven method. The experimental test method generally has high requirements for equipment, and usually requires the system to be shut down for a large number of tests and analyses, so it is impossible to perform online diagnosis and continuous monitoring and fault prevention of the system. The model-based method requires the establishment of accurate PEMFC physical and mathematical models, but PEMFC is a nonlinear complex system with multiple physical fields and multi-parameter coupling, so it is difficult to establish its fault model. The data-driven method, especially the deep learning neural network, can use a large amount of experimental data for training and automatically learn features, thereby reducing dependence on prior knowledge. It is suitable for the diagnosis of complex systems, can diagnose unknown faults, does not need to rely on physical models or experimental equipment, and can adapt to a variety of fault types and scenarios. However, the existing deep learning-based neural network proton exchange membrane fuel cell fault diagnosis method is not accurate, and cannot support offline and online fault diagnosis at the same time. Summary of the invention
[0005] Purpose of the invention: In view of the above problems, the present invention proposes a proton exchange membrane fuel cell fault diagnosis method and system based on improved YOLOv5, which improves the accuracy of fault diagnosis and supports both offline and online fault diagnosis.
[0006] Technical solution: The technical solution adopted by the present invention is a proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, comprising: taking the characteristic signal image of the proton exchange membrane fuel cell as input, outputting the fault type through the trained YOLOv5-EGA_R_MGD model for offline and online fault diagnosis;
[0007] The YOLOv5-EGA_R_MGD model includes: improving the YOLOv5 model to obtain the YOLOv5-EGA model; performing lightweight improvement on the YOLOv5-EGA model as a whole through a random pruning algorithm; using a mask generation distillation MGD algorithm to perform knowledge distillation on the randomly pruned YOLOv5-EGA model to compensate for the accuracy loss caused by lightweighting, thereby obtaining a YOLOv5-EGA_R_MGD model;
[0008] The improved YOLOv5 model to obtain the YOLOv5-EGA model includes: based on the YOLOv5 model architecture, using the EfficientViT network to replace the original trunk Backbone module, using the Gold-YOLO network to replace the original neck Neck module, and adding the ASF-YOLO network to obtain the YOLOv5-EGA model;
[0009] The ASF-YOLO network includes a scale sequence feature fusion SSFF module and a channel and position attention mechanism CPAM module. The SSFF module fuses the feature information of different scales at the tail of the EfficientViT network to obtain the result input2, which is input into the CPAM module together with the result input1 output by the convolution layer after the second Inject module. The outputs of the third Inject module, the fourth Inject module and the CPAM module are all subjected to another convolution operation and then input into the head module together.
[0010] As a preferred solution of the above-mentioned proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, the EfficientViT network includes: building an EfficientViT Block as a basic module, and the EfficientViTBlock includes: the input features of each EfficientViT Block first pass through N feedforward network FFN layers, then pass through a cascade group attention CGA layer, and finally pass through N FFN layers to transform the output features; add an overlapping patch embedding overlap patchEmbed layer at the input end of the EfficientViT Block, and sequentially connect the downsampling Subsample layer and the average pooling AvgPool layer at the output end of the EfficientViT Block to obtain the EfficientViT network.
[0011] As a preferred solution of the above-mentioned proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, the Gold-YOLO network also adds Low-FAM module, Low-IFM module, High-FAM module and High-IFM module to the basic architecture:
[0012] The Low-FAM collects and aligns feature information from different levels of output in the EfficientViT network to obtain result A, and inputs result A into the Low-IFM module, first obtains global feature information through multi-layer convolution, and then divides the global feature information into two parts b and c; b is input into the first Inject module in the Gold-YOLO network, and c is input into the second Inject module in the Gold-YOLO network;
[0013] The High-FAM collects and aligns feature information output from the EfficientViT network and feature information output at different levels in the Gold-YOLO network to obtain result D, which is input into the High-IFM module to first obtain global feature information through multi-layer convolution, and then divide the global feature information into two parts e and f; e is input into the third Inject module in the Gold-YOLO network, and f is input into the fourth Inject module in the Gold-YOLO network.
[0014] As a preferred solution of the above-mentioned proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, the Low-FAM module collects and aligns feature information from layers 1, 2, 4, and 7 to obtain result A; the High-FAM module collects and aligns feature information from layers 7, 13, and 17 to obtain result D; the two parts b and c output by the Low-IFM module, b is input to the Inject module of the 12th layer, and c is input to the Inject module of the 16th layer; the two parts e and f output by the High-IFM module, e is input to the Inject module of the 21st layer, and f is input to the Inject module of the 24th layer; the SSFF module fuses feature information of different scales of layers 5, 6, and 7.
[0015] As a preferred solution of the above-mentioned proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, the pruning ratio of the random pruning algorithm is 4.0.
[0016] As a preferred solution of the above-mentioned proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, the mask generation distillation MGD algorithm is used to perform knowledge distillation on the randomly pruned YOLOv5-EGA model, including: using the YOLOv5-EGA model as the teacher model, the pruned YOLOv5-EGA model as the student model, specifying the 5th, 11th, 15th, and 20th layers as feature layers, calculating the loss between the feature maps of the corresponding layers of the teacher model and the student model, and outputting the student model with the smallest loss.
[0017] In the above-mentioned proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, the fault type is output through the trained YOLOv5-EGA_R_MGD model, including:
[0018] Offline fault diagnosis: According to the variables of the PEMFC system during operation, the characteristic signal image of the PEMFC is obtained by screening and normalization; the PEMFC fault type is determined offline using the trained YOLOv5-EGA_R_MGD model;
[0019] Online fault diagnosis: By capturing the real-time screen of the host computer, the characteristic signal image of the proton exchange membrane fuel cell is obtained after screening and normalization, and the real-time screen is used to judge the fault type of the proton exchange membrane fuel cell online through the trained YOLOv5-EGA_R_MGD model.
[0020] In the above-mentioned proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, the sample set used for YOLOv5-EGA_R_MGD model training includes: collecting real-time images of the host computer of the proton exchange membrane fuel cell system during the operation of the locomotive, and obtaining characteristic signal images of the fuel cell in flooding fault, membrane dry fault, normal state and unknown state after filtering and normalizing the real-time images, and taking the characteristic signal images as the sample set;
[0021] The above-mentioned proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 also includes evaluating and testing the trained YOLOv5-EGA_R_MGD model before using the YOLOv5-EGA_R_MGD model for offline and online fault detection:
[0022] The evaluation of the trained YOLOv5-EGA_R_MGD model includes: setting evaluation indicators, using parameter quantity, FLOPs, model size, mAP and latency as evaluation indicators to evaluate the model;
[0023] Testing the trained YOLOv5-EGA_R_MGD model includes: porting the YOLOv5-EGA_R_MGD model to an embedded device equipped with a processing chip and testing it.
[0024] The present invention provides a proton exchange membrane fuel cell fault diagnosis system based on improved YOLOv5, comprising a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 is implemented.
[0025] The present invention provides a computer program product, comprising a computer program and / or instructions, which, when executed by a processor, implements the proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5.
[0026] Beneficial effects: Compared with the prior art, the present invention has the following advantages: 1. Compared with the YOLOv5-EGA_R_MGD model and the YOLOv5s model, the model performs well in terms of parameter quantity, FLOPs, model volume, mAP and latency. 2. Compared with the offline fault diagnosis machine learning algorithm that has been used in real life, the algorithm of this paper has a higher diagnostic accuracy, and the algorithm of this paper can be applied to online fault diagnosis, with fast diagnostic speed and high accuracy. 3. The YOLOv5-EGA_R_MGD model described in the present invention has a small number of parameters and low latency, and can be embedded and transplanted to complete the landing application of the offline and online fault diagnosis portable device of PEMFC. Based on the model, the fault diagnosis of the PEMFC system is carried out, and the results show that it can not only perform offline diagnosis, but also perform real-time online diagnosis of multiple parameter curves of PEMFC. The model has low latency and small size and can be transplanted into embedded devices to realize the practical application of the offline and online fault diagnosis portable device of PEMFC, which has important theoretical significance and practical application value for improving the fault diagnosis technology, reliability and durability of the PEMFC system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a schematic diagram of the structure of the efficient visual transformation module EfficientViT (Efficient Vision Transformer, EfficientViT);
[0028] Figure 2 This is a schematic diagram of the EfficientViT network model structure;
[0029] Figure 3It is the feature alignment module FAM (Feature Alignment Module, FAM) and information fusion module (Information Fusion Module, IFM) module;
[0030] Figure 4 It is the Inject module;
[0031] Figure 5 It is the Scale Sequence Feature Fusion SSFF (Scale Sequence Feature Fusion, SSFF) module and the Channel and Position Attention Mechanism CPAM (Channel and Position Attention Mechanism, CMAP) module;
[0032] Figure 6 It is the YOLOv5-EGA model, including: (a) YOLOv5s original model structure diagram; (b) improved YOLOv5-EGA model structure diagram; (c) improved part detailed diagram;
[0033] Figure 7 This is the YOLOv5-EGA pruning effect diagram;
[0034] Figure 8 is the model performance after distillation;
[0035] Fig. 9 It is a schematic diagram of online diagnosis. DETAILED DESCRIPTION
[0036] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0037] The improved YOLOv5-based proton exchange membrane fuel cell fault diagnosis method of the present invention uses the improved YOLOv5 network model to perform fault diagnosis on PEMFC flooding fault, membrane dry fault, normal state and unknown state. It includes: according to the variables of the proton exchange membrane fuel cell system during operation, the characteristic signal image of the proton exchange membrane fuel cell is obtained by screening and normalization; the characteristic signal image of the proton exchange membrane fuel cell is used as input, and the fault type is output through the trained YOLOv5-EGA_R_MGD model for offline and online fault diagnosis.
[0038] The YOLOv5-EGA_R_MGD model includes: improving the YOLOv5 model to obtain the YOLOv5-EGA model; using the random pruning algorithm to make lightweight improvements to the YOLOv5-EGA model as a whole; using the mask generation distillation algorithm to perform knowledge distillation on the randomly pruned YOLOv5-EGA model to compensate for the accuracy loss caused by lightweighting, and obtain the YOLOv5-EGA_R_MGD model;
[0039] The YOLOv5-EGA model is obtained by improving the YOLOv5 model, including: based on the YOLOv5 model architecture, using the EfficientViT network to replace the original Backbone module of the torso, using the Gold-YOLO network to replace the original Neck module, and adding the ASF-YOLO network to obtain the YOLOv5-EGA model;
[0040] The ASF-YOLO network includes a scale sequence feature fusion SSFF module and a channel and position attention mechanism CPAM module. The SSFF module fuses the feature information of different scales at the tail of the EfficientViT network to obtain the result input2, which is input into the CPAM module together with the result input1 output by the convolution layer after the second Inject module. The outputs of the third Inject module, the fourth Inject module and the CPAM module are all convolved again and then input into the Head module together.
[0041] The following is a detailed description of several parts (steps):
[0042] S100 uses a 100kW evaporative cooling (EC) proton exchange membrane fuel cell to obtain multiple variables during the operation of the fuel cell system. After screening and normalization, a total of 5,000 sets of characteristic signal images under different states of the fuel cell are obtained as sample sets;
[0043] S200, based on the YOLOv5 model, uses EfficientViT as the network backbone, and combines the ideas of Gold-YOLO and ASF-YOLO to improve its neck to obtain the YOLOv5-EGA model;
[0044] S300, a lightweight improvement of the YOLOv5-EGA model through a pruning algorithm;
[0045] S400, uses the knowledge distillation method to compensate for the accuracy loss caused by lightweighting, and obtains the YOLOv5-EGA_R4.0_MGD model;
[0046] S500, the YOLOv5-EGA_R4.0_MGD model is applied to the offline and online fault diagnosis of the PEMFC system, and its effect is verified.
[0047] In step S100, a 100kW EC-type PEMFC system is used to obtain multiple variables during the operation of the PEMFC system, and a total of 5000 groups of characteristic signal images under different states of the PEMFC are obtained as a sample set after screening and normalization, including the steps of:
[0048] S101, collecting multi-sensor data of the proton exchange membrane fuel cell system and the current system status during the operation of the locomotive;
[0049] S102, after screening and normalization, 5000 sets of characteristic signal images of the fuel cell in the water flooding fault, membrane dry fault, normal state and unknown state are obtained as sample sets. The training set is 1000 sets each of the water flooding fault, membrane dry fault, normal state and unknown state. The test set is 250 sets each of the water flooding fault, membrane dry fault, normal state and unknown state.
[0050] In step S200, based on the YOLOv5 model, EfficientViT is used as the network backbone, and the neck is improved by combining the ideas of Gold-YOLO and ASF-YOLO to obtain the YOLOv5-EGA model, including the following steps:
[0051] S201, build EfficientViT Block as the basic module, such as Figure 1 As shown in Figure 1, the input features of each EfficientViTBlock first pass through N feed-forward network FFN (Feed-Forward Network, FFN) layers, then pass through a cascaded group attention layer CGA (Cascaded Group Attention, CGA) layer, and finally pass through N feed-forward network FFN layers to obtain the output features. Between, use cascaded group attention layers Do spatial integration;
[0052] S202, add the overlapping patch embedding layer overlap patchEmbed, the downsampling layer Subsample, and the average pooling layer AvgPool (Average Pooling Layer) to improve the network structure, and form a complete EfficientViT network model with the EfficientViT Block, such as Figure 2 As shown;
[0053] S203, such as Figure 3As shown in the figure, a feature alignment module FAM (Feature Alignment Module, FAM) is built to collect and align feature information from different levels, and an information fusion module IFM (Information Fusion Module, IFM) fuses the aligned feature information to generate global feature information. Low-FAM collects and aligns feature information from layers 1, 2, 4, and 7, and High-FAM collects and aligns feature information from layers 7, 13, and 17. The output of IFM is first extracted through multi-layer convolution, and then split into two parts to be used as input for subsequent Inject operations. The feature map obtained in this process is regarded as global information. The architecture of High-IFM has also been adjusted. In view of the reduced feature dimension of the High-FAM output, in order to better integrate global information, we replaced the repblock in the low-stage aggregation-distribution part Low-GD (Low-stage Gather-and-Distribute) and introduced a transformer module based on convolution. In this improved transformer, we replace the traditional linear layer with a convolution operation and replace the layer normalization layernorm with batch normalization batch norm. The information injection module Inject distributes global information to each level to enhance detection capabilities, such as Figure 4 As shown;
[0054] S204, build the Scale Sequence Feature Fusion SSFF (SSFF) module to fuse feature information of different scales, and introduce the attention mechanism of the channel and position attention module CPAM (CPAM) to focus on the most informative channels and spatial positions to improve the detection ability of complex scenes, such as Figure 5 As shown;
[0055] S205, based on YOLOv5, the model is improved, the EfficientViT network model is used as its torso, and the combination of Gold-YOLO, SSFF and CPAM is used as its neck. The new improved model is recorded as YOLOv5-EGA, as shown in Figure 6 As shown. Figure 6(a) YOLOv5s original model structure diagram and (b) improved YOLOv5-EGA model structure diagram, refer to (c) improved part detailed diagram, it can be seen that based on the YOLOv5s original model structure, the YOLOv5-EGA model structure has been specifically improved:
[0056] (1) The image input enters the new torso part, namely the EfficientViT network, for feature extraction;
[0057] (2) The L-FAM module, i.e., Low-FAM, collects and aligns feature information from layers 1, 2, 4, and 7 to obtain result A, which is input to the L-IFM module, i.e., Low-IFM. Information is first extracted through multi-layer convolutions and then split into two parts b and c, where b is input to the Inject module at layer 12 and c is input to the Inject module at layer 16.
[0058] (3) The H-FAM module, i.e. High-FAM, collects and aligns feature information from layers 7, 13, and 17 to obtain result D, which is input to the H-IFM module, i.e. High-IFM, to obtain results e and f, where e is input to the Inject module of layer 21 and f is input to the Inject module of layer 24;
[0059] (4) The SSFF module fuses the feature information of different scales from layers 5, 6, and 7 to obtain the result G, which is input into the CPAM module together with the result H output from the 17th convolutional layer.
[0060] (5) The outputs of the 21st layer Inject module, the 26th layer Inject module and the CPAM module are convolved again, and the results are input into the Head modules respectively.
[0061] In step S300, the YOLOv5-EGA model is lightweighted and improved by a pruning algorithm, including the following steps:
[0062] S301, Slim pruning algorithm is a sparse learning method that uses implicit regularization to achieve pruning. By optimizing the implicit sparse constraints in the objective function, the redundant parameters in the model are gradually reduced, and pruning is automatically performed during the training process without additional manual intervention. The model will eventually become more sparse, but still maintain high accuracy, which is suitable for scenarios that require real-time computing and storage optimization. Random Pruning Random Pruning is a simple and direct pruning method that prunes by randomly selecting some weights in the network. Without complex algorithms or calculations, a certain proportion of weights or neurons are directly randomly removed, which can be applied to any neural network structure. Since pruning is performed randomly, it may cause unstable performance, and multiple experiments are required to find the optimal pruning ratio. LAMP (Layer-Adaptive Magnitude-based Pruning) is a layer-adaptive pruning method based on weight size, which determines which weights need to be pruned by evaluating the size of the weights. Pruning is performed according to the size of the weights of each layer, retaining important weights and removing unimportant parts. The weights of each layer are evaluated and pruned separately to adapt to the importance distribution of different layers. By reasonably selecting the pruning threshold, the model parameters can be greatly reduced while ensuring the accuracy of the model, and the computational efficiency can be improved. The pruning operation is a pruning operation performed on the entire model. The above three pruning algorithms and different pruning ratios are used to lightweight the YOLOv5-EGA model as a whole to obtain multiple models. Taking the random pruning algorithm as an example, by modifying the pruning ratio, the random_2.0 model (using the YOLOv5-EGA model as the original model, using the random pruning algorithm, and the pruning ratio is 2.0), the random_3.0 model (using the YOLOv5-EGA model as the original model, using the random pruning algorithm, and the pruning ratio is 3.0) and the random_4.0 model (using the YOLOv5-EGA model as the original model, using the random pruning algorithm, and the pruning ratio is 4.0) can be obtained.
[0063] S302, adjust the pruning ratio to balance the relationship between model accuracy and parameter quantity. The effect is as follows Figure 7 As shown;
[0064] In step S400, the knowledge distillation method is used to compensate for the accuracy loss caused by lightweighting, and the YOLOv5-EGA_R4.0_MGD model is obtained, including the following steps:
[0065] S401, MGD (Masked Generative Distillation, MGD) is a knowledge distillation method that aims to enhance the performance of the student model through multi-level information transfer. Traditional knowledge distillation usually focuses on the output of a single level, while MGD uses the feature information of multiple intermediate layers of the teacher model to learn the student model, making the learning effect better. The MGD algorithm is used to distill each pruned model. Each model refers to: multiple models obtained by pruning the YOLOv5-EGA model as a whole with different pruning algorithms and different pruning ratios.
[0066] S402, use YOLOv5-EGA as the teacher model, the pruned model as the student model, specify the 5th, 11th, 15th, and 20th layers as feature layers, calculate the loss between the feature maps of the corresponding layers of the teacher model and the student model, and optimize the parameters of the student model through back propagation to improve its performance and efficiency. The effect is as follows Figure 8 shown.
[0067] In step S500, the YOLOv5-EGA_R4.0_MGD model is applied to the offline and online fault diagnosis of the PEMFC system, and its effect is verified, including the steps of:
[0068] S501, set evaluation indicators: use parameter quantity, FLOPs, model size, mAP and latency as evaluation indicators to evaluate the model;
[0069] S502, the optimized model is compared with the YOLOv5s model, and the results are shown in Table 1.
[0070] Table 1
[0071]
[0072] S503, offline fault diagnosis: Traditional machine learning algorithms SVM, KNN and deep learning algorithms CNN are currently widely used in fault diagnosis of bearings, motors, fuel cells, etc., and have shown good fault diagnosis effects. The feasibility of this method for fault diagnosis is further verified by comparing YOLOv5-EGA_R4.0_MGD with traditional algorithms. The experimental results are shown in Table 2.
[0073] Table 2
[0074]
[0075] S504, online fault diagnosis: Traditional algorithms cannot perform offline and online fault diagnosis at the same time, while the YOLOv5-EGA_R4.0_MGD algorithm performs fault diagnosis by capturing the real-time screen of the host computer, such as Fig. 9As shown in the figure, the diagnosis accuracy rate of 200 faults was 98%.
[0076] S505, transplant YOLOv5-EGA_R4.0_MGD to the embedded device equipped with RV1126AI chip, and test the feasibility and effect of YOLOv5-EGA_R4.0_MGD algorithm on the mobile terminal. Through the detection and verification of 200 faults, the feasibility of YOLOv5-EGA_R4.0_MGD for embedded transplantation was obtained, and the diagnosis accuracy was 95.2%, and the accuracy decreased by 2.9%.
[0077] In one embodiment, a proton exchange membrane fuel cell fault diagnosis system based on improved YOLOv5 is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 when executing the computer program.
[0078] In one embodiment, a computer program product is provided, including a computer program and / or instructions, which, when executed by a processor, implements the proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5.
[0079] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0080] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0081] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
Claims
1. A proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5, characterized in that: include: Taking the characteristic signal image of the proton exchange membrane fuel cell as input, the fault type is output through the trained YOLOv5-EGA_R_MGD model for offline and online fault diagnosis; The YOLOv5-EGA_R_MGD model includes: improving the YOLOv5 model to obtain the YOLOv5-EGA model; performing lightweight improvement on the YOLOv5-EGA model as a whole by using a random pruning algorithm; performing knowledge distillation on the randomly pruned YOLOv5-EGA model by using a mask generation distillation MGD algorithm to obtain the YOLOv5-EGA_R_MGD model; The improved YOLOv5 model to obtain the YOLOv5-EGA model includes: based on the YOLOv5 model architecture, using the EfficientViT network to replace the original trunk Backbone module, using the Gold-YOLO network to replace the original neck Neck module, and adding the ASF-YOLO network to obtain the YOLOv5-EGA model; The ASF-YOLO network includes a scale sequence feature fusion SSFF module and a channel and position attention mechanism CPAM module. The SSFF module fuses the feature information of different scales at the tail of the EfficientViT network to obtain the result input2, which is input into the CPAM module together with the result input1 output by the convolution layer after the second Inject module. The outputs of the third Inject module, the fourth Inject module and the CPAM module are all subjected to another convolution operation and then input into the head module together.
2. The proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 according to claim 1, characterized in that: The EfficientViT network includes: building an EfficientViT Block as a basic module, wherein the EfficientViT Block includes: the input features of each EfficientViT Block first pass through N feedforward network FFN layers, then pass through a cascade group attention CGA layer, and finally pass through N FFN layers to transform and obtain output features; adding an overlap patch embedding overlap patchEmbed layer at the input end of the EfficientViT Block, and sequentially connecting a downsampling Subsample layer and an average pooling AvgPool layer at the output end of the EfficientViTBlock to obtain the EfficientViT network.
3. The proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 according to claim 1, characterized in that: The Gold-YOLO network also adds Low-FAM module, Low-IFM module, High-FAM module and High-IFM module to the basic architecture: The Low-FAM collects and aligns feature information from different levels of output in the EfficientViT network to obtain result A, and inputs result A into the Low-IFM module, first obtains global feature information through multi-layer convolution, and then divides the global feature information into two parts b and c; b is input into the first Inject module in the Gold-YOLO network, and c is input into the second Inject module in the Gold-YOLO network; The High-FAM collects and aligns feature information output from the EfficientViT network and feature information output at different levels in the Gold-YOLO network to obtain result D, which is input into the High-IFM module to first obtain global feature information through multi-layer convolution, and then divide the global feature information into two parts e and f; e is input into the third Inject module in the Gold-YOLO network, and f is input into the fourth Inject module in the Gold-YOLO network.
4. The proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 according to claim 3 is characterized in that: The Low-FAM module collects and aligns feature information from layers 1, 2, 4, and 7 to obtain result A; the High-FAM module collects and aligns feature information from layers 7, 13, and 17 to obtain result D; the two parts b and c output by the Low-IFM module, b is input to the Inject module of the 12th layer, and c is input to the Inject module of the 16th layer; the two parts e and f output by the High-IFM module, e is input to the Inject module of the 21st layer, and f is input to the Inject module of the 24th layer; the SSFF module fuses feature information of different scales of layers 5, 6, and 7.
5. The proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 according to claim 1, characterized in that: The pruning factor of the random pruning algorithm is 4.
0.
6. The proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 according to claim 1, characterized in that: The mask generation distillation (MGD) algorithm is used to perform knowledge distillation on the randomly pruned YOLOv5-EGA model, including: using the YOLOv5-EGA model as the teacher model and the pruned YOLOv5-EGA model as the student model, specifying the 5th, 11th, 15th, and 20th layers as feature layers, calculating the loss between the feature maps of the corresponding layers of the teacher model and the student model, and outputting the student model with the minimum loss.
7. The proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 according to claim 1, characterized in that: The trained YOLOv5-EGA_R_MGD model outputs the fault types, including: Offline fault diagnosis: According to the variables of the PEMFC system during operation, the characteristic signal image of the PEMFC is obtained by screening and normalization; the PEMFC fault type is determined offline using the trained YOLOv5-EGA_R_MGD model; Online fault diagnosis: By capturing the real-time screen of the host computer, the characteristic signal image of the proton exchange membrane fuel cell is obtained after screening and normalization, and the real-time screen is used to judge the fault type of the proton exchange membrane fuel cell online through the trained YOLOv5-EGA_R_MGD model.
8. The proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 according to claim 1, characterized in that: The sample set used for YOLOv5-EGA_R_MGD model training includes: collecting real-time images of the host computer of the proton exchange membrane fuel cell system during the operation of the locomotive, filtering and normalizing the real-time images to obtain characteristic signal images of the fuel cell under flooding fault, membrane dry fault, normal state and unknown state, and taking the characteristic signal images as the sample set; The proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 also includes evaluating and testing the trained YOLOv5-EGA_R_MGD model: The evaluation of the trained YOLOv5-EGA_R_MGD model includes: setting evaluation indicators, using parameter quantity, FLOPs, model size, mAP and latency as evaluation indicators to evaluate the model; Testing the trained YOLOv5-EGA_R_MGD model includes: porting the YOLOv5-EGA_R_MGD model to an embedded device equipped with a processing chip and testing it.
9. A proton exchange membrane fuel cell fault diagnosis system based on improved YOLOv5, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 according to any one of claims 1 to 8 is implemented.
10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or instruction is executed by a processor, the proton exchange membrane fuel cell fault diagnosis method based on improved YOLOv5 described in any one of claims 1 to 8 is implemented.