PEMFC cross-stack fault diagnosis method and system based on transfer learning
Patent Information
- Application Number
- CN202210885726.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-07-26
AI Technical Summary
[0037]The beneficial effects of the method and system of this invention are as follows: First, this invention acquires fuel cell pile data and trains and filters the parameters of a CNN model to obtain the parameter data with the best fault diagnosis gain for the target fuel cell pile under test and the optimal fuel cell pile data, wherein the best parameter data is used as transfer learning parameters; second, the transfer learning parameters and the optimal fuel cell pile data are used to transfer parameters of the CNN model to obtain a pre-trained fault diagnosis model; finally, the fuel cell pile data is used to classify and train the pre-trained fault diagnosis model to obtain a fault diagnosis model, which can better match fuel cell piles with similar fault states to the target fuel cell pile under test for auxiliary fault diagnosis. Through this core matching operation, the theoretical basis for the effectiveness of transfer learning and the accuracy of fault diagnosis can be improved.
Smart Images

Figure CN115169492B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fuel cell stack fault diagnosis, and in particular to a method and system for cross-fuel cell stack fault diagnosis based on transfer learning in PEMFC. Background Technology
[0002] Depending on the severity of the damage to the fuel cell stack, PEMFC stack faults can be categorized into unrecoverable faults and recoverable faults. Recoverable faults refer to those that temporarily cause abnormal stack output during operation, primarily including short circuits, overloads, flooding, and gas shortages. Compared to other faults, PEMFC stack recoverable faults are characterized by high frequency and recoverability. Accurate diagnosis of PEMFC recoverable faults can effectively improve the service life of PEMFC stacks, making research on recoverable faults of significant value.
[0003] Chinese patent document CN202210078254.X discloses a gearbox fault detection method based on deep transfer learning. The method includes collecting raw signal data from the gearbox, performing noise reduction and data cleaning on the raw signals, extracting features using a feature extractor, obtaining new images, constructing a model, and analyzing and validating the model using training and validation data. It cross-combines image data of gearbox vibration, temperature, and oil signals to obtain multiple sets of composite image data, ultimately constructing a composite fault model. The obtained convolutional neural network model is then transferred to gearbox diagnostic detection data, and the transfer diagnosis fault rate is calculated. This achieves high-precision diagnosis and rapid fault detection of gearboxes under composite fault conditions. However, it does not use multiple different devices to train the model and obtain the corresponding model parameters for each device. Summary of the Invention
[0004] To address the aforementioned technical problems, the present invention aims to provide a PEMFC cross-stack fault diagnosis method and system based on transfer learning, which can improve the accuracy of the fault diagnosis model.
[0005] The first technical solution adopted in this invention is: a PEMFC cross-stack fault diagnosis method based on transfer learning, comprising the following steps:
[0006] Acquire fuel cell pile data and train a CNN model to obtain transfer learning parameters and optimal fuel cell pile data;
[0007] A fault diagnosis model is obtained by training a CNN model using transfer learning parameters, optimal fuel cell pile data, and fuel cell pile data.
[0008] Based on the fault diagnosis model, fault diagnosis is performed on the target fuel cell stack under test, and the fault diagnosis results are obtained.
[0009] Furthermore, the step of acquiring the fuel cell pile data and training the CNN model to obtain the transfer learning parameters and optimal fuel cell pile data specifically includes:
[0010] Acquire and divide the fuel cell stack data to obtain auxiliary fuel cell stack data and target fuel cell stack data;
[0011] The auxiliary parameters are obtained by training the CNN model parameters using auxiliary heap data;
[0012] The target parameters are obtained by training the CNN model parameters using the target heap data;
[0013] The auxiliary parameters are tested based on the target parameters to obtain the transfer learning parameters and the optimal fuel cell stack data.
[0014] Furthermore, the step of training the CNN model parameters using auxiliary heap data to obtain auxiliary parameters specifically includes:
[0015] The auxiliary fuel cell stack data is divided into training and testing sets;
[0016] The parameters of the CNN model are trained using the training set to obtain the auxiliary parameters to be tested;
[0017] The trained CNN model was tested using a test set to obtain the test accuracy.
[0018] The auxiliary parameters to be tested are filtered based on the test accuracy to obtain the auxiliary parameters.
[0019] Furthermore, the step of testing the auxiliary parameters based on the target parameters to obtain the transfer learning parameters and the optimal fuel cell stack data specifically includes:
[0020] The random forest model is trained based on the target parameters to obtain a classifier;
[0021] The auxiliary parameters are tested based on the classifier to obtain the accuracy of the auxiliary parameter test;
[0022] The auxiliary parameters are filtered based on the accuracy of the auxiliary parameter test, and the transfer learning parameters and optimal fuel cell data are obtained from the filtered auxiliary parameters-fuel cell dataset.
[0023] Furthermore, the step of training the CNN model using transfer learning parameters, optimal fuel cell pile data, and fuel cell pile data to obtain the fault diagnosis model specifically includes:
[0024] The training rules for training CNN models using optimal heap data are transferred to the target domain data.
[0025] The optimal fuel cell stack data is used as the source domain data, and the transfer learning parameters are used as the source domain parameters. Based on the training rules, the parameters of the CNN model are transferred to obtain the pre-trained fault diagnosis model.
[0026] The pre-trained fault diagnosis model is classified and trained using fuel cell stack data to obtain the fault diagnosis model.
[0027] Furthermore, the CNN model includes an input layer, three one-dimensional convolutional layers, a pooling layer, and a fully connected layer. Each convolutional layer is accompanied by a normalization layer and an activation layer.
[0028] Furthermore, the step of performing fault diagnosis on the target fuel cell stack under test based on the fault diagnosis model to obtain the fault diagnosis result specifically includes:
[0029] Input the data of the target fuel cell stack under test into the fault diagnosis model;
[0030] The input layer inputs the data of the target electric stack under test into the convolutional layer for convolution, normalization and activation processing to obtain convolutional data;
[0031] The convolutional data is input into the pooling layer for global average pooling to obtain a one-dimensional vector.
[0032] A one-dimensional vector is input into a fully connected layer for activation, and the fault diagnosis result is obtained.
[0033] The second technical solution adopted in this invention is: a PEMFC cross-stall fault diagnosis system based on transfer learning, comprising:
[0034] The data acquisition module is used to acquire fuel cell pile data and train the CNN model to obtain transfer learning parameters and optimal fuel cell pile data.
[0035] The model building module is used to train the CNN model using transfer learning parameters, optimal fuel cell pile data, and fuel cell pile data to obtain a fault diagnosis model.
[0036] The fault diagnosis module performs fault diagnosis on the target fuel cell stack under test based on the fault diagnosis model and obtains the fault diagnosis results.
[0037] The beneficial effects of the method and system of this invention are as follows: First, this invention acquires fuel cell pile data and trains and filters the parameters of a CNN model to obtain the parameter data with the best fault diagnosis gain for the target fuel cell pile under test and the optimal fuel cell pile data, wherein the best parameter data is used as transfer learning parameters; second, the transfer learning parameters and the optimal fuel cell pile data are used to transfer parameters of the CNN model to obtain a pre-trained fault diagnosis model; finally, the fuel cell pile data is used to classify and train the pre-trained fault diagnosis model to obtain a fault diagnosis model, which can better match fuel cell piles with similar fault states to the target fuel cell pile under test for auxiliary fault diagnosis. Through this core matching operation, the theoretical basis for the effectiveness of transfer learning and the accuracy of fault diagnosis can be improved. Attached Figure Description
[0038] Figure 1 This is a flowchart of the steps of a PEMFC cross-stack fault diagnosis method based on transfer learning according to the present invention.
[0039] Figure 2 This is a structural block diagram of a PEMFC cross-stack fault diagnosis system based on transfer learning according to the present invention;
[0040] Figure 3 This is a schematic diagram of the single auxiliary stack parameter training process in a specific embodiment of the present invention;
[0041] Figure 4 This is a schematic diagram of the multi-auxiliary stack parameter training process in a specific embodiment of the present invention;
[0042] Figure 5 This is a schematic diagram of the fault diagnosis model training process in a specific embodiment of the present invention;
[0043] Figure 6 This is a schematic diagram of model fine-tuning in a specific embodiment of the present invention;
[0044] Figure 7 This is a schematic diagram of the fault diagnosis model structure in a specific embodiment of the present invention. Detailed Implementation
[0045] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.
[0046] Reference Figure 1 This invention provides a PEMFC cross-stack fault diagnosis method based on transfer learning, which includes the following steps:
[0047] S1. Acquire the fuel cell heap data and train the CNN model to obtain the transfer learning parameters and the optimal fuel cell heap data;
[0048] The CNN model consists of an input layer, three one-dimensional convolutional layers, a global average pooling layer, and a fully connected layer. Each convolutional layer is accompanied by a normalization layer and an activation layer, and finally outputs a classification label.
[0049] S1.1 Acquire and divide the fuel cell stack data to obtain auxiliary fuel cell stack data and target fuel cell stack data;
[0050] S1.2. Train the CNN model parameters using auxiliary heap data to obtain auxiliary parameters;
[0051] Specifically, the auxiliary fuel cells are numbered from 1 to n, such as... Figure 3 As shown, taking the acquisition of auxiliary fuel cell stack 1 parameters as an example, in auxiliary fuel cell stack 1, data x with fault label y is first collected using a multi-dimensional sensor. The collected dataset is d1={(x1,y1),(x2,y2),...,(x n ,y n Next, the auxiliary heap 1 dataset d1 is divided into training and testing sets. A CNN (one-dimensional convolutional neural network) model is used, which contains w layers, each with several trainable parameters θ. Then, the CNN model parameters are trained using the training set to obtain the parameter set s1 = {θ} of each layer of the CNN model. 1 ,θ 2 ,...,θ w Then, the trained CNN model is tested using the test set to obtain the test accuracy Acc1; finally, the above training and testing operations are repeated k times to obtain the model parameter sets for each iteration. and the accuracy of each test exist Select the optimal accuracy The corresponding model parameter set That is, the auxiliary fuel cell stack parameter 1.
[0052] like Figure 4 As shown, the method for obtaining the parameters of auxiliary fuel cell stack 1 is used to obtain the data of the remaining auxiliary fuel cell stacks 2 to n. The various recoverable fault data of the n numbered PEMFC fuel cell stacks are denoted as d1 to d2. n Using data d1 to d2 respectively n The operation of acquiring the parameters of auxiliary stack 1 was performed, and the following results were obtained: Finally, auxiliary parameters are obtained.
[0053] S1.3. Train the CNN model parameters using the target heap data to obtain the target parameters;
[0054] Specifically, the various recoverable fault data of the target PEMFC stack are denoted as d0. The CNN is trained using the dataset d0 to obtain the parameter set s of each layer of the CNN model. 0 Repeat the above training process j times to obtain the target parameters.
[0055] S1.4. Test the auxiliary parameters based on the target parameters to obtain the transfer learning parameters and the optimal fuel cell stack data.
[0056] Specifically, using the target parameter S 0 Train a random forest model to obtain a classifier CL, and then use the classifier CL with auxiliary parameters S. best Tests were conducted on the above, and the results were obtained. For each corresponding accuracy, we obtain the auxiliary parameters and their corresponding stack i for the highest accuracy. The auxiliary parameters corresponding to the highest accuracy are the transfer learning parameters, and the corresponding stack dataset d is the data set d. i This is the optimal fuel cell stack data.
[0057] S2, such as Figure 5 As shown, the CNN model is trained using transfer learning parameters, optimal fuel cell pile data, and fuel cell pile data to obtain a fault diagnosis model.
[0058] S2.1. Utilize transfer learning parameters and optimal fuel cell data to perform parameter transfer on the CNN model to obtain a pre-trained fault diagnosis model;
[0059] In this study, the optimal fuel cell stack data is used as the source domain data, and the transfer learning parameters are used as the source domain parameters. The transfer learning parameters are then used to train the CNN model, employing the model parameter transfer learning method, which is also a method for model fine-tuning. The goal is to transfer the source domain data D... s Training rule f s Migrate to target domain data D t To prevent overfitting, the objective is to solve for SRM. This process is mathematically expressed as:
[0060]
[0061] In the above formula, def is a definition.
[0062] The source domain dataset D in this embodiment s Includes multiple fault samples
[0063]
[0064] In the above formula, j represents the j-th type of fault sample, and n represents the total number of types.
[0065] Target domain dataset D tIt also consists of multiple partitioned subsets. composition:
[0066]
[0067] In the above formula, l is the l-th subset, and m is the total number of subsets.
[0068] For the feature mapping function H of the source domain and target domain tasks s (·) and H t (·), the network output T(D) corresponding to the source and target domains. s ) and T(D t This can be represented as:
[0069] T(D s )=H s (x s ,y s ;θ s );
[0070] T(D t )=H t (x t ,y t ;θ t );
[0071] In the above formula, (x s ,y s (x) represents source domain stack data. t ,y t The target domain is the fuel cell stack data, and the source domain is the network parameters. The network parameters of the target domain are The fine-tuning principle of this embodiment can be represented as mapping the parameters learned by the source domain convolutional neural network onto the target domain θ. s →θ t ,like Figure 6 As shown.
[0072] S2.2. Use the fuel cell stack data to perform classification training on the pre-trained fault diagnosis model to obtain the fault diagnosis model.
[0073] Specifically, the fuel cell data used in this step refers to the target fuel cell data. The parameters learned by the three convolutional layers of the pre-trained fault diagnosis model are frozen and used as the convolutional layer model of the target fuel cell data. The model is then learned using a new global pooling layer and a fully connected layer to obtain the fault diagnosis model.
[0074] Among them, the fault diagnosis model is as follows Figure 7As shown, the network consists of an input layer, three one-dimensional convolutional layers, a global average pooling layer, and a fully connected layer. Each convolutional layer is accompanied by a normalization layer and an activation layer, finally outputting a classification label. The input layer adapts to the data size. The first convolutional layer uses a large kernel to give it a large receptive field. The kernel size of the first layer is set to 9x1, with 128 channels and a stride of 1. The kernel size of each subsequent layer gradually decreases to learn the features passed from the previous layer more meticulously. The kernel size of the second layer is 5x1, with 256 channels and a stride of 1, and the kernel size of the third layer is 3x1. With 128 channels and a stride of 1, each convolutional operation of the diagnostic signal goes through three sub-layers: convolution, normalization, and activation. The output of the last convolutional layer is sent to a global average pooling layer with a stride of 2 to perform downsampling, reducing model complexity and preventing overfitting. After pooling, the output is unfolded into a one-dimensional vector and input to a fully connected layer. The fully connected layer is an adaptive input-output layer, where the hidden layer uses the ReLU activation function to compress the features of the previous layer, and the output layer uses the Softmax activation function to ensure that the output fully covers the feature information of the previous layer's input. After passing through the activation function, the output is the predicted value.
[0075] It is important to note that each convolutional operation is followed by a BN normalization layer and a ReLU activation function layer, before the next convolutional layer. This setup enhances the model's generalization ability.
[0076] S3. Based on the fault diagnosis model, perform fault diagnosis on the target fuel cell stack under test and obtain the fault diagnosis results.
[0077] Specifically, such as Figure 7 As shown, the target fuel cell stack data matrix x is first input into the fault diagnosis model. The input layer inputs the target fuel cell stack data into the convolutional layer for convolution, normalization and activation processing to obtain the convolutional data matrix y. Then, after global average pooling, the convolutional data matrix y is expanded into a one-dimensional vector and input into the fully connected layer. Finally, after passing through the activation function, the predicted value is output, which is the fault diagnosis result.
[0078] Furthermore, the present invention also discloses a PEMFC cross-stack fault diagnosis device based on transfer learning, including various sensors, IoT communication devices, databases and cloud platforms;
[0079] The various sensors are used to collect data for each fuel cell stack;
[0080] The IoT communication device is used to transmit the collected fuel cell data;
[0081] The database is used to store and use data from multiple fuel cell stacks;
[0082] The cloud platform is used to load fault diagnosis algorithms based on transfer learning to implement the fault diagnosis process.
[0083] like Figure 2 As shown, a PEMFC cross-stack fault diagnosis system based on transfer learning includes:
[0084] The data acquisition module is used to acquire fuel cell pile data and train the CNN model to obtain transfer learning parameters and optimal fuel cell pile data.
[0085] The model building module is used to train the CNN model using transfer learning parameters, optimal fuel cell pile data, and fuel cell pile data to obtain a fault diagnosis model.
[0086] The fault diagnosis module performs fault diagnosis on the target fuel cell stack under test based on the fault diagnosis model and obtains the fault diagnosis results.
[0087] The content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0088] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A PEMFC cross-stack fault diagnosis method based on transfer learning, characterized in that, Includes the following steps: Acquire fuel cell pile data and train a CNN model to obtain transfer learning parameters and optimal fuel cell pile data; A fault diagnosis model is obtained by training a CNN model using transfer learning parameters, optimal fuel cell pile data, and fuel cell pile data. Based on the fault diagnosis model, fault diagnosis is performed on the target fuel cell stack under test, and the fault diagnosis results are obtained. The step of acquiring fuel cell pile data and training a CNN model to obtain transfer learning parameters and optimal fuel cell pile data specifically includes: Acquire and divide the fuel cell stack data to obtain auxiliary fuel cell stack data and target fuel cell stack data; The auxiliary parameters are obtained by training the CNN model parameters using auxiliary heap data; The target parameters are obtained by training the CNN model parameters using the target heap data; The auxiliary parameters are tested based on the target parameters to obtain the transfer learning parameters and the optimal fuel cell stack data; The CNN model includes an input layer, three one-dimensional convolutional layers, a global average pooling layer, and a fully connected layer. Each convolutional layer is accompanied by a normalization layer and an activation layer. The kernel size of each convolutional layer gradually decreases. The step of training the CNN model parameters using auxiliary heap data to obtain auxiliary parameters specifically includes: The auxiliary fuel cell stack data is divided into training and testing sets; The parameters of the CNN model are trained using the training set to obtain the auxiliary parameters to be tested; The trained CNN model was tested using a test set to obtain the test accuracy. The auxiliary parameters to be tested are selected based on the test accuracy to obtain the auxiliary parameters; The step of testing auxiliary parameters based on target parameters to obtain transfer learning parameters and optimal stack data specifically includes: The random forest model is trained based on the target parameters to obtain a classifier; The auxiliary parameters are tested based on the classifier to obtain the accuracy of the auxiliary parameter test; The auxiliary parameters are filtered based on the accuracy of the auxiliary parameter test. The transfer learning parameters and the optimal fuel cell data are obtained from the filtered auxiliary parameter-fuel cell dataset, that is, the auxiliary parameters and fuel cell corresponding to the highest accuracy.
2. The method for cross-stall fault diagnosis of PEMFC based on transfer learning according to claim 1, characterized in that, The step of training the CNN model using transfer learning parameters, optimal fuel cell pile data, and fuel cell pile data to obtain the fault diagnosis model specifically includes: The training rules for training a CNN model using optimal heap data are transferred to the target domain data. The optimal fuel cell stack data is used as the source domain data, and the transfer learning parameters are used as the source domain parameters. Based on the training rules, the parameters of the CNN model are transferred to obtain the pre-trained fault diagnosis model. The pre-trained fault diagnosis model is trained by classifying the target fuel cell stack data to obtain the fault diagnosis model.
3. The method for cross-stall fault diagnosis of PEMFC based on transfer learning according to claim 1, characterized in that, The step of performing fault diagnosis on the target fuel cell stack under test based on the fault diagnosis model and obtaining the fault diagnosis result specifically includes: Input the data of the target fuel cell stack under test into the fault diagnosis model; The input layer inputs the data of the target electric stack under test into the convolutional layer for convolution, normalization and activation processing to obtain convolutional data; The convolutional data is input into the pooling layer for global average pooling to obtain a one-dimensional vector. A one-dimensional vector is input into a fully connected layer for activation, and the fault diagnosis result is obtained.
4. A PEMFC cross-stack fault diagnosis system based on transfer learning, characterized in that, A method for performing a PEMFC cross-stall fault diagnosis based on transfer learning as described in claim 1 includes: The data acquisition module is used to acquire fuel cell pile data and train the CNN model to obtain transfer learning parameters and optimal fuel cell pile data. The model building module is used to train the CNN model using transfer learning parameters, optimal fuel cell pile data, and fuel cell pile data to obtain a fault diagnosis model. The fault diagnosis module performs fault diagnosis on the target fuel cell stack under test based on the fault diagnosis model and obtains the fault diagnosis results.
Citation Information
Patent Citations
Gear case fault detection method based on deep transfer learning
CN114298288A