A method for diagnosing faults of a pem electrolyzer and a domain alignment network model architecture

By using the Sinkhorn algorithm and entropy regularization optimal transport technology, a domain-aligned network model was constructed, which solved the cross-domain generalization problem of fault diagnosis in PEM electrolyzers under off-grid environment, and achieved efficient and real-time fault identification and diagnosis.

CN121144968BActive Publication Date: 2026-03-03SHANGHAI JIAOTONG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511685364.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-03-03
Estimated Expiration
2045-11-18

AI Technical Summary

Technical Problem

Existing PEM electrolyzer fault diagnosis methods are difficult to cope with dynamic and non-stationary operating conditions in off-grid environments, and traditional domain adaptive methods have insufficient generalization performance in cross-domain scenarios, especially when there are serious feature confusions due to differences between devices and sudden changes in operating conditions.

Method used

The Sinkhorn algorithm is used to efficiently align the feature distributions of the source and target domains. By entropy regularization of the optimal transport problem, a domain alignment network model is constructed to achieve cross-domain distribution matching. A one-dimensional convolutional neural network is combined for feature extraction and dynamic domain alignment, and the classification and alignment loss functions are optimized.

Benefits of technology

The generalization ability of the PEM electrolyzer fault diagnosis model in cross-equipment or cross-operating condition migration tasks has been improved, solving the problem of scarce fault samples and real-time diagnosis requirements in dynamic environments, and realizing lightweight design and efficient feature extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144968B_ABST
    Figure CN121144968B_ABST
Patent Text Reader

Abstract

This specification discloses a fault diagnosis method and domain alignment network model architecture for PEM electrolyzers. The fault diagnosis method includes: acquiring a source domain dataset, a target domain dataset, and a source domain fault diagnosis model; extracting features from the source domain dataset and the target domain dataset based on the source domain fault diagnosis model to obtain the source domain feature distribution and the target domain feature distribution; using the Sinkhorn algorithm to obtain the optimal transmission distance between the source domain feature distribution and the target domain feature distribution; calculating a loss function based on the optimal transmission distance, and updating the model parameters of the source domain fault diagnosis model with minimizing the loss function as the update objective to obtain the target domain fault diagnosis model; and performing fault diagnosis on the target domain dataset based on the target domain fault diagnosis model. By modeling the cross-domain distribution matching problem as an entropy-regularized optimal transportation problem, the generalization bottleneck of traditional models in off-grid scenarios is overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Several embodiments in this specification relate to the field of electrolytic cell fault diagnosis technology, specifically to the optimization of the generalization capability of the PEM electrolytic cell fault diagnosis model. Background Technology

[0002] Green hydrogen systems refer to systems that produce hydrogen using renewable energy sources (such as wind, solar, and hydropower) through technologies like water electrolysis. Proton exchange membrane (PEM) electrolyzers, as the core equipment in green hydrogen systems, are crucial to the stability of off-grid energy systems due to their reliable operation. Because off-grid environments present complex and variable operating conditions, PEM electrolyzers frequently face multiple dynamic disturbances such as current density fluctuations and temperature changes, easily leading to faults such as abnormal thermal management and membrane electrode degradation, severely impacting system lifespan and hydrogen production efficiency. Therefore, achieving accurate identification and early warning of PEM electrolyzer faults has become a critical technological requirement urgently needing breakthroughs in the field of green hydrogen safety.

[0003] Currently, research on fault diagnosis of PEM electrolyzers mainly focuses on data-driven methods, such as traditional machine learning models and deep learning networks. Most existing methods rely on data collected from a single device under steady-state operating conditions for model training, employing feature engineering combined with classifiers or time-series models for state identification. Furthermore, to improve the model's generalization ability under varying conditions, some studies have introduced domain adaptation techniques, such as feature distribution matching methods based on maximum mean difference (MMD) or correlation alignment (CORAL), attempting to reduce the distribution difference between the source and target domains, thereby achieving knowledge transfer with limited target labels.

[0004] However, existing methods still have significant limitations. On the one hand, fault samples are extremely scarce in practical applications, and most diagnostic models heavily rely on steady-state data for training, making it difficult to cope with dynamic and non-stationary operating conditions in off-grid environments. On the other hand, traditional domain adaptation methods often rely on edge distribution alignment, ignoring class structure information, which can easily lead to feature confusion between classes. In addition, domain alignment methods based on statistical moment matching have limited ability to capture higher-order distribution features, and their generalization performance and alignment effect are still unsatisfactory when facing complex cross-domain scenarios such as differences between devices and sudden changes in operating conditions. Summary of the Invention

[0005] This specification provides a PEM electrolyzer fault diagnosis method and domain alignment network model architecture. By modeling the cross-domain distribution matching problem as an entropy regularized optimal transportation problem, it overcomes the residual bias problem of traditional domain adaptation methods and breaks through the generalization bottleneck of traditional models in off-grid scenarios.

[0006] The technical solution is as follows:

[0007] Firstly, embodiments of this specification provide a method for diagnosing faults in a PEM electrolyzer, comprising the following steps:

[0008] Obtain the source domain dataset, the target domain dataset, and the source domain fault diagnosis model obtained by training the model to be trained using the source domain dataset;

[0009] Based on the source domain fault diagnosis model, feature extraction is performed on the source domain dataset and the target domain dataset respectively to obtain the source domain feature distribution corresponding to the source domain dataset and the target domain feature distribution corresponding to the target domain dataset. The source domain feature distribution represents the statistical characteristics of all feature vectors extracted from the source domain dataset, and the target domain feature distribution represents the statistical characteristics of all feature vectors extracted from the target domain dataset.

[0010] The Sinkhorn algorithm is used to obtain the optimal transmission distance between the source domain feature distribution and the target domain feature distribution based on the source domain feature distribution and the target domain feature distribution;

[0011] The loss function is calculated based on the optimal transmission distance, and the model parameters of the source domain fault diagnosis model are updated with minimizing the loss function as the update target to obtain the target domain fault diagnosis model.

[0012] Fault diagnosis is performed on the target domain dataset based on the target domain fault diagnosis model.

[0013] As a preferred embodiment, the step of obtaining the optimal transmission distance between the source domain feature distribution and the target domain feature distribution using the Sinkhorn algorithm includes:

[0014] Based on the source domain feature distribution and the target domain feature distribution, the Sinkhorn algorithm is used to obtain the first transmission distance characterizing the cross-domain transmission cost.

[0015] Based on the source domain feature distribution, the Sinkhorn algorithm is used to obtain the second transmission distance characterizing the source domain self-transmission cost.

[0016] The Sinkhorn algorithm is used to obtain the third transmission distance, which characterizes the self-transmission cost of the target domain, based on the target domain feature distribution.

[0017] The optimal transmission distance is obtained based on the first transmission distance, the second transmission distance, and the third transmission distance.

[0018] As a preferred embodiment, the Sinkhorn algorithm includes an entropy regularization coefficient; the fault diagnosis method further includes:

[0019] Based on the source domain fault diagnosis model, feature extraction is performed on the source domain dataset and the target domain dataset respectively to obtain the source domain feature vector set corresponding to the source domain dataset and the target domain feature vector set corresponding to the target domain dataset.

[0020] The entropy regularization coefficient is updated based on the difference between the domain features of the source domain feature vector set and the target domain feature vector set.

[0021] As a preferred embodiment, the loss function is a domain alignment loss function; the source domain dataset includes multiple source domain samples and their respective corresponding real fault labels, and the target domain dataset includes multiple target domain samples;

[0022] The optimal transmission distance between the source domain feature distribution and the target domain feature distribution is obtained using the Sinkhorn algorithm, including:

[0023] Based on the source domain fault diagnosis model, the pseudo fault label corresponding to each target domain sample in the target domain dataset is obtained. Both the real fault label and the pseudo fault label include multiple fault categories.

[0024] For any fault category, the optimal transmission sub-distance between the source domain feature distribution and the target domain feature distribution corresponding to the fault category is obtained based on the source domain feature distribution and the target domain feature distribution; this step is repeated until the optimal transmission sub-distance corresponding to each fault category is obtained and the optimal transmission distance is formed.

[0025] The loss function calculated based on the optimal transmission distance includes:

[0026] The domain alignment loss function is calculated based on the optimal transmission sub-distance and preset weight value corresponding to each fault category.

[0027] As a preferred embodiment, the loss function further includes classification loss and regularization loss.

[0028] As a preferred embodiment, each of the source domain samples and each of the target domain samples includes at least one of the following operating data: current density, output voltage, temperature, cathode pressure, anode pressure, and hydrogen production.

[0029] The source domain fault diagnosis model extracts features from both the source domain dataset and the target domain dataset, including:

[0030] An adaptive average pooling method is used to extract features from each source domain sample and each target domain sample.

[0031] As a preferred embodiment, the fault categories include no fault, abnormal thermal management fault, and electrolytic cell degradation fault;

[0032] The acquisition of the source domain dataset and the target domain dataset includes:

[0033] The duty cycle of the heaters in the PEM electrolyzers corresponding to the source and target domains was adjusted respectively to simulate abnormal thermal management faults.

[0034] Degradation voltages were applied to the PEM electrolyzers corresponding to the source and target domains, respectively, to simulate electrolyzer degradation faults.

[0035] As a preferred embodiment, obtaining the source domain dataset and the target domain dataset includes:

[0036] Acquire multiple time-series data collected from the source and target domains respectively;

[0037] Each time series data is divided into multiple overlapping windows of fixed length to obtain multiple data samples corresponding to each time series data.

[0038] The source domain dataset is obtained by using all data samples of each time series data in the corresponding source domain, and the target domain dataset is obtained by using all data samples of each time series data in the corresponding target domain.

[0039] As a preferred embodiment, the step of dividing each time series data into multiple overlapping windows of fixed length to obtain multiple data samples corresponding to each time series data further includes:

[0040] Each data sample was normalized.

[0041] Secondly, embodiments of this specification provide a domain alignment network model architecture that applies the method described in the first aspect of the above embodiments, including a feature extraction module and a domain alignment module employing a one-dimensional convolutional neural network.

[0042] The feature extraction module includes a multi-level progressive convolutional layer that extracts input data into high-dimensional feature vectors and a fault classification layer that reduces the high-dimensional feature vectors to obtain feature vectors of a preset dimension.

[0043] The multi-level progressive convolutional layer includes an adaptive average pooling layer;

[0044] The domain alignment module updates the model parameters using the Sinkhorn algorithm based on the preset dimension feature vector output by the fault classification layer.

[0045] Thirdly, embodiments of this specification provide an electronic device, including a processor and a memory; the processor is connected to the memory; the memory is used to store executable program code; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to perform the steps described in the first aspect of the above embodiments.

[0046] Fourthly, embodiments of this specification provide a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the steps described in the first aspect of the above embodiments.

[0047] The beneficial effects of the technical solutions provided in some embodiments of this specification include at least the following:

[0048] 1. The Sinkhorn algorithm is used to efficiently align the feature distributions of the source and target domains to solve the distribution offset problem in PEM electrolyzer fault diagnosis, thereby improving the model's generalization ability in cross-equipment or cross-operating condition migration tasks.

[0049] 2. Entropy regularization optimal transportation provides a high-order distribution matching framework, overcoming the linear limitations of traditional methods.

[0050] 3. Dynamic adjustment of regularization coefficients and inter-class alignment mechanism transform equipment and operating condition differences into filterable noise.

[0051] 4. End-to-end lightweight design ensures that a single training session can be applied to multiple domains in PEM electrolyzer fault diagnosis.

[0052] 4. By simulating faults, the problem of high cost and low probability of obtaining fault samples (such as membrane electrode degradation and abnormal thermal management) of PEM electrolyzers in the actual off-grid operating environment is overcome, which leads to a serious lack of training data.

[0053] 5. Simultaneous optimization of classification and alignment using joint loss function.

[0054] 6. Construct a domain alignment network architecture that includes a feature extraction module and a dynamic domain alignment module to achieve collaborative optimization of local feature extraction and global distribution alignment.

[0055] 7. The hierarchical progressive convolution design in the lightweight 1D-CNN architecture enables efficient feature extraction, and adaptive average pooling compresses the time dimension to generate fixed-length feature vectors. This overcomes the problem that traditional diagnostic methods are computationally complex and have response delays, making it difficult to meet the engineering requirements of millisecond-level response. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 This is a flowchart illustrating a PEM electrolyzer fault diagnosis method provided in the embodiments of this specification.

[0058] Figure 2 This is a comparison chart of the fault diagnosis accuracy of our method and the comparison method under different migration tasks.

[0059] Figure 3 This is a schematic diagram of the structure of an electronic device provided in the embodiments of this specification. Detailed Implementation

[0060] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings.

[0061] The terms "first," "second," "third," etc., in the description, claims, and accompanying drawings are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0062] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this specification. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.

[0063] In off-grid scenarios for PEM electrolyzers, equipment differences (such as sensor calibration deviations) and changes in operating conditions (such as dynamic load fluctuations) cause a shift in the feature distribution between the source and target domains. For example, the normal state characteristics of device 1 may be misjudged as a fault on device 2. Therefore, this application is proposed.

[0064] Reference Figure 1 As shown, Figure 1 A flowchart illustrating a PEM electrolyzer fault diagnosis method provided in one embodiment of this specification may include at least the following steps:

[0065] Step 202: Obtain the source domain dataset, the target domain dataset, and the source domain fault diagnosis model obtained by training the model to be trained using the source domain dataset;

[0066] Step 204: Based on the source domain fault diagnosis model, perform feature extraction on the source domain dataset and the target domain dataset respectively, and obtain the source domain feature distribution corresponding to the source domain dataset and the target domain feature distribution corresponding to the target domain dataset. The source domain feature distribution represents the statistical characteristics of all feature vectors extracted from the source domain dataset, and the target domain feature distribution represents the statistical characteristics of all feature vectors extracted from the target domain dataset.

[0067] Step 206: Based on the source domain feature distribution and the target domain feature distribution, use the Sinkhorn algorithm to obtain the optimal transmission distance between the source domain feature distribution and the target domain feature distribution;

[0068] Step 208: Calculate the loss function based on the optimal transmission distance, and update the model parameters of the source domain fault diagnosis model with minimizing the loss function as the update target to obtain the target domain fault diagnosis model;

[0069] Step 210: Perform fault diagnosis on the target domain dataset based on the target domain fault diagnosis model.

[0070] Explanatoryly, PEM (proton exchange membrane) electrolyzers are widely used in off-grid green hydrogen energy systems. Due to fluctuations in off-grid wind and solar power generation, operating conditions on the same equipment frequently switch, and operating conditions vary significantly across different equipment. Therefore, the dynamic characteristics of the off-grid environment require PEM electrolyzer fault diagnosis to have real-time response capabilities and strong adaptability. However, traditional deep learning model training processes require large amounts of continuously labeled operational data, which is difficult to meet practical needs.

[0071] Model transfer learning utilizes abundant samples from the source domain to train an initial model, requiring only partial operating condition data for the target domain. Knowledge transfer is rapidly achieved through domain alignment, meeting the real-time response and strong adaptability requirements for PEM electrolytic cell fault diagnosis in off-grid environments. In deep transfer learning, the source domain refers to known equipment and operating conditions, and the source domain dataset is the set of data collected under known equipment and operating conditions. The target domain refers to the new equipment and / or new operating conditions to be transferred, and the target domain dataset is the set of data collected under the new equipment and / or new operating conditions to be transferred. The goal of deep transfer learning is to achieve good generalization performance on the target domain, that is, to accurately classify or predict unlabeled new samples in the target task.

[0072] In this embodiment, the source domain fault diagnosis model serves as the original model, and its parameters are adjusted to adapt to the distribution differences in the target domain. Transfer learning methods based on minimizing distribution differences are widely used in existing technologies, with MMD (Multi-Dimensional Distribution) being a common metric. However, MMD suffers from limitations in accuracy and convergence speed when dealing with complex distributions, particularly high-dimensional data and class imbalances. Therefore, to improve the effectiveness of condition adaptation and address the fault diagnosis problem in off-grid electrolyzers, this embodiment replaces MMD distance with Sinkhorn distance, avoiding dependence on distribution moments and thus more effectively handling the nonlinear dynamic features in PEM electrolyzer data to improve distribution alignment capabilities.

[0073] Illustratively, this embodiment models the distribution alignment problem between the source and target domains as an entropy-regularized optimal transportation problem. MMD relies on kernel functions to measure distributional differences, tending to capture the mean embedding differences of distributions. The goal of the optimal transportation problem (Optimal Transfort) is to transform one probability distribution into another at the minimum cost, directly measuring the optimal transmission cost between the two distributions and more accurately characterizing higher-order statistical information. Although the optimal transmission distance has good theoretical properties, directly solving the optimal transportation problem often suffers from high computational complexity and poor numerical stability. Therefore, an entropy regularization term is further introduced into the original optimal transportation problem, resulting in an entropy-regularized optimal transportation problem, i.e., the Sinkhorn algorithm:

[0074]

[0075] in, For the optimal transmission distance, μ represents the source domain feature distribution, and v represents the target domain feature distribution. The feature distribution is the statistical distribution characteristic of all feature vectors in space, which can be used to observe the spatial clustering areas of different fault categories. i Let y be the i-th source domain sample in the source domain dataset Xs. j For the j-th target domain sample in the target domain dataset Xt, Let be the cost function between samples, and the squared Euclidean distance between feature vectors is often chosen. γ is the transport scheme matrix, γ ij To convert the source domain sample x i Migration to target domain sample y j The amount of data transmitted. Let σ represent the set of transfer matrices that satisfy the edge constraints, where σ is the entropy regularization coefficient.

[0076] This regularization not only smooths the transmission scheme matrix, but also transforms the problem into a convex optimization problem. The local optimal solution of a convex optimization problem is the global optimal solution, which allows the problem to be solved efficiently by the Sinkhorn-Knopp clustering algorithm to find the transmission plan γ, and then calculate the optimal transmission distance.

[0077] This embodiment adjusts model parameters through a loss function constraint, forcing the model to learn domain-invariant features that characterize the nature of the fault and remain unchanged regardless of equipment or operating conditions. For example, the loss function is a domain alignment loss function. By iteratively updating the model parameters, the optimal transmission distance corresponding to the model parameters in each iteration is substituted into the loss function, and the gradient of the loss function with respect to the model parameters is calculated to guide the iteration of the model parameters. Minimizing the loss function yields the closest optimal transmission distance, and the model under the current model parameters becomes the target domain fault diagnosis model.

[0078] In one embodiment of this specification, the optimal transmission distance between the source domain feature distribution and the target domain feature distribution is obtained using the Sinkhorn algorithm, including:

[0079] Based on the source domain feature distribution and the target domain feature distribution, the Sinkhorn algorithm is used to obtain the first transmission distance characterizing the cross-domain transmission cost.

[0080] Based on the source domain feature distribution, the Sinkhorn algorithm is used to obtain the second transmission distance characterizing the source domain self-transmission cost.

[0081] The Sinkhorn algorithm is used to obtain the third transmission distance, which characterizes the self-transmission cost of the target domain, based on the target domain feature distribution.

[0082] The optimal transmission distance is obtained based on the first transmission distance, the second transmission distance, and the third transmission distance.

[0083] Explanatory, direct use There is a problem with using distance as a feature distribution between different domains: when the two distributions are the same, i.e., μ=v, Non-zero values ​​violate the requirement that distance metrics should satisfy reflexivity, i.e. This could lead to deviations in cross-domain tasks. Therefore, this embodiment further refines the optimal transmission distance, defining it as:

[0084]

[0085] in, The corrected optimal transmission distance is the original optimal transmission distance. That is, the first transmission distance. For the second transmission distance, This is the third transmission distance.

[0086] It can capture higher-order distribution differences and has better numerical stability.

[0087] In one embodiment of this specification, the Sinkhorn algorithm includes an entropy regularization coefficient; the fault diagnosis method further includes:

[0088] Based on the source domain fault diagnosis model, feature extraction is performed on the source domain dataset and the target domain dataset respectively to obtain the source domain feature vector set corresponding to the source domain dataset and the target domain feature vector set corresponding to the target domain dataset.

[0089] The entropy regularization coefficient is updated based on the difference between the domain features of the source domain feature vector set and the target domain feature vector set.

[0090] Explained, in the Sinkhorn algorithm, the entropy regularization strength σ is a crucial parameter affecting distance performance. As σ approaches 0, the optimal transmission distance tends towards a solution to a biased optimal transmission problem; as σ approaches infinity, the optimal transmission distance tends towards satisfying a marginal distribution. In practical applications, the distance and other characteristics of data features change with training. A fixed σ may not be suitable for all operating conditions simultaneously. To address this issue, this embodiment proposes a dynamic adjustment strategy for the entropy regularization coefficient:

[0091]

[0092]

[0093] Among them, F s For the source domain feature vector set, F t This is the set of feature vectors for the target domain. and These are the setting of the maximum and minimum values ​​of σ, respectively. σ is adjusted in real time based on the magnitude of the difference in domain features to ensure training effectiveness and efficiency. To adjust the coefficients and prevent self-feedback oscillations, this embodiment selects the magnitude of the domain feature difference, i.e., the inter-domain distance d, as the feedback index. During training, σ will adjust according to d. and The model is dynamically updated between domains. When the inter-domain distance d is large, σ is increased to smooth alignment; when d is small, σ is decreased to preserve details. This ensures that the model maintains efficient convergence across different domain feature differences.

[0094] In one embodiment of this specification, the loss function is a domain alignment loss function; the source domain dataset includes multiple source domain samples and their respective corresponding real fault labels, and the target domain dataset includes multiple target domain samples;

[0095] The Sinkhorn algorithm is used to obtain the optimal transmission distance between the source domain feature distribution and the target domain feature distribution, based on the source domain feature distribution and the target domain feature distribution, including:

[0096] Based on the source domain fault diagnosis model, the pseudo fault label corresponding to each target domain sample in the target domain dataset is obtained. Both the real fault label and the pseudo fault label include multiple fault categories.

[0097] For any fault category, the optimal transmission sub-distance between the source domain feature distribution and the target domain feature distribution corresponding to the fault category is obtained based on the source domain feature distribution and the target domain feature distribution; this step is repeated until the optimal transmission sub-distance corresponding to each fault category is obtained and the optimal transmission distance is formed.

[0098] The loss function is calculated based on the optimal transmission distance, including:

[0099] The domain alignment loss function is calculated based on the optimal transmission sub-distance and preset weight value corresponding to each fault category.

[0100] Interpretive differences between category-conditional distributions play a crucial role in domain adaptation. Therefore, this embodiment further calculates the category-conditional optimal transmission distance, i.e., the optimal transmission sub-distance, to ensure class-level alignment and avoid feature confusion between different fault categories. Fs is grouped by fault category based on the true fault labels, and in the target domain, pseudo-fault labels are predicted using the source domain fault diagnosis model. Ft is also grouped by fault category based on the pseudo-fault labels. For each fault category, the category-conditional optimal transmission distance of the source domain feature distribution and the target domain feature distribution is calculated separately, and the domain alignment loss is obtained by weighted summation. .

[0101]

[0102] Among them, the function denoted by entropy regularization, the optimal transmission distance is used to measure the distribution difference between two feature sets; C represents the total number of fault categories, c represents any fault category, and p(c) is the preset weight value of category c, which can be set according to the class distribution in the target domain, or according to the class frequency or empirical prior in the target domain, to balance the influence of different categories in the alignment process. and These represent the source domain feature vector subset and the target domain feature vector subset, respectively, for category c.

[0103] For illustrative purposes, since the target domain often lacks labeled data, this embodiment uses the diagnostic results output by the source domain fault diagnosis model as labeled data to solve the problem of scarce labeled data in the target domain and enhance the effect and robustness of cross-domain feature alignment.

[0104] In one embodiment of this specification, the loss function further includes classification loss and regularization loss.

[0105] Explanatoryly, the overall loss function in this embodiment consists of several parts, including classification loss. Domain alignment loss and regularization loss .

[0106]

[0107] Explained, the classification loss represents the loss based on the source domain data, used to extract effective data features. The domain alignment loss represents the domain adaptation loss, a hyperparameter that balances the two losses, used to make the features of the source domain data and the target domain data similar. The regularization loss is used to prevent the model from becoming overly complex and overfitting. λ and α1 are hyperparameters used to balance the three terms. In actual training, the network parameters are continuously updated through backpropagation and stochastic gradient descent optimization algorithms to minimize this overall loss, thereby minimizing the empirical risk of the model on the dataset.

[0108] A single end-to-end loss function simultaneously optimizes classification and alignment, achieving efficient convergence and high diagnostic accuracy. This solves the suboptimal solution problem caused by the separation of classification and alignment in traditional methods.

[0109] In one embodiment of this specification, each source domain sample and each target domain sample includes at least one of the following operating data: current density, output voltage, temperature, cathode pressure, anode pressure, and hydrogen production.

[0110] Based on the source domain fault diagnosis model, feature extraction is performed on the source domain dataset and the target domain dataset respectively, including:

[0111] An adaptive average pooling method is used to extract features from each source domain sample and each target domain sample.

[0112] Interpretive, adaptive average pooling is used instead of fixed pooling to convert the dynamic parameter sequences (current density, output voltage, temperature, etc.) in each source domain sample and each target domain sample into high-dimensional fault feature vectors, compressing the variable-length sequence into fixed-dimensional features, providing discriminative input for subsequent domain distribution alignment and classification, and satisfying the model's cross-device generalization.

[0113] In one embodiment of this specification, the fault categories include no fault, thermal management abnormality fault, and electrolytic cell degradation fault;

[0114] Obtain the source domain dataset and the target domain dataset, including:

[0115] The duty cycle of the heaters in the PEM electrolyzers corresponding to the source and target domains was adjusted respectively to simulate abnormal thermal management faults.

[0116] Degradation voltages were applied to the PEM electrolyzers corresponding to the source and target domains, respectively, to simulate electrolyzer degradation faults.

[0117] Explanatoryly, PEM electrolyzers have a low failure rate in off-grid environments (the target lifespan set by the U.S. Department of Energy is 80,000 hours), and the cost of obtaining failure samples is extremely high, resulting in a scarcity of failure samples. To address the problem of insufficient labeled failure data, artificial interference is applied to PEM electrolyzers to simulate failure phenomena.

[0118] For illustrative purposes, the heater is part of the electrolytic cell auxiliary system. The degradation voltage is applied to the cell voltage within the electrolytic cell. The specific simulation method is as follows: standard operating parameters are used under normal conditions; thermal management anomalies are simulated by increasing the heater duty cycle; electrolytic cell degradation is simulated by adding degradation voltage to reflect the dynamic changes in the actual off-grid environment, greatly expanding the fault sample.

[0119] In one embodiment of this specification, obtaining the source domain dataset and the target domain dataset includes:

[0120] Acquire multiple time-series data collected from the source and target domains respectively;

[0121] Each time series data is divided into multiple overlapping windows of fixed length to obtain multiple data samples corresponding to each time series data.

[0122] The source domain dataset is obtained by using all data samples of each time series data in the corresponding source domain, and the target domain dataset is obtained by using all data samples of each time series data in the corresponding target domain.

[0123] Interpretive, the sliding window reconstruction algorithm is used to divide all time series data into a uniform length, processing them into a large number of fixed-length samples. At the same time, while standardizing the sample length, key temporal dependencies are preserved, ensuring robust and scale-invariant input, and significantly improving the efficiency and diversity of data utilization.

[0124] In one embodiment of this specification, each time series data is divided into multiple overlapping windows of fixed length to obtain multiple data samples corresponding to each time series data, and then the method further includes:

[0125] Each data sample was normalized.

[0126] Interpretive datasets typically contain a variety of physical quantities (e.g., current, voltage, temperature), and these quantities vary significantly in magnitude. To avoid the impact of magnitude imbalance on model convergence, this embodiment uses a standardization method to unify the dimensions of various running data in the dataset, constructing the basic input unit that the model can process, and ensuring that the data scale input to the model is consistent.

[0127] For example, the normalization method uses z-score normalization to convert each type of running data into a standard normal distribution. The algorithm can be specifically expressed as follows:

[0128]

[0129] Where x and σ0 and σ0 represent the original value and the normalized value after processing, respectively, while μ0 and σ0 represent the sample mean and standard deviation, respectively.

[0130] It should be noted that no restrictions are placed on the normalization method used in this example.

[0131] This invention overcomes three major challenges in fault diagnosis of proton exchange membrane electrolyzers in off-grid green hydrogen energy systems: real-time adaptability in highly dynamic environments, lack of labeled fault data, and insufficient generalization ability of models trained on single-device steady-state datasets.

[0132] This specification also provides a domain-aligned network model architecture that applies the methods described in the above embodiments.

[0133] The domain alignment network model architecture includes a feature extraction module and a domain alignment module that employ a one-dimensional convolutional neural network;

[0134] The feature extraction module includes a multi-level progressive convolutional layer that extracts high-dimensional feature vectors from the input data and a fault classification layer that reduces the dimensionality of the high-dimensional feature vectors to obtain feature vectors of a preset dimension.

[0135] Multi-level progressive convolutional layers include adaptive average pooling layers;

[0136] The domain alignment module updates the model parameters using the Sinkhorn algorithm based on the preset dimension feature vector output by the fault classification layer.

[0137] Explained, this embodiment proposes a cross-domain diagnostic framework that employs a lightweight one-dimensional convolutional neural network feature extractor and a domain alignment module based on the Sinkhorn algorithm to achieve efficient alignment convergence and ensure high cross-domain diagnostic accuracy.

[0138] Multi-level progressive convolutional layers extract and enhance features step by step, understanding signals layer by layer from local to global, and accurately capturing the essence of faults. Multi-level progressive convolutional layers can extract features with fewer parameters, making the model more lightweight and suitable for real-time systems.

[0139] Adaptive average pooling layers replace the fixed pooling layers in traditional CNNs, enabling the conversion of running sequences of any length into fixed-dimensional fault feature vectors to handle variable-length temporal inputs. This decouples the model from the data input size, improving the model's generalization ability to adapt to data inputs from different devices and operating conditions.

[0140] This architecture can flexibly adapt to different sliding window partitioning methods used under different devices and operating conditions, ensuring consistent feature dimensions in the final output. Data from the source domain may be best analyzed using a window of L=100, while data from the target domain may be better captured by a window of L=150 to capture its fault characteristics. Furthermore, the optimal window length may differ between steady-state and drastically fluctuating operating conditions. Under this architecture, the model can accommodate these different window choices without forcing a specific window size.

[0141] For example, a multi-level progressive convolutional layer consists of 4 levels of modules.

[0142] Module 1: The layer type is "Conv1d+BN+ReLU+MaxPool+Dropout". The input channel dimension is 5-dimensional time series data (current density, output voltage, temperature, cathode pressure, anode pressure). After processing by 64 convolutional kernels, the output dimension is L / 2×64. This module extracts local features through convolutional kernels, performs batch normalization to stabilize the distribution, introduces nonlinearity through ReLU activation, compresses the time dimension through max pooling, and prevents overfitting through Dropout.

[0143] Module 2: The layer type is "Conv1d+BN+ReLU+MaxPool+Dropout" structure, with the input channels expanded to 128 dimensions and the output dimension further compressed to L / 4×128. This stage improves feature diversity by increasing the number of convolutional kernels while maintaining the same regularization strategy as Module 1.

[0144] Module 3: The layer type is "Conv1d+BN+ReLU+Adaptive AvgPool", and the input channels are expanded to 256 dimensions. The key improvement is the use of adaptive average pooling instead of fixed pooling, compressing the output dimension to 1×256. This operation achieves global aggregation in the time dimension while preserving rich features in the channel dimension.

[0145] Module 4: The layer type is "Conv1d+BN+ReLU+Adaptive AvgPool" structure, with the input channels expanded to 512 dimensions and the output fixed as a 1×512 dimensional feature vector. Through continuous channel expansion, the feature representation capability is significantly enhanced.

[0146] Fault classification layer: The linear layer maps the 512-dimensional input to a 128-dimensional fault feature space, achieving final feature dimensionality reduction. The output of this layer serves as the input feature for the domain alignment module.

[0147] Validate and evaluate the multi-dimensional performance of the model:

[0148] First, datasets for the source and target domains are collected. The target domain datasets include a first target domain dataset B and a second target domain dataset C. Specifically, the first target domain dataset B and the source domain dataset A correspond to the same PEM electrolyzer under different operating conditions, while the second target domain dataset C and the source domain dataset A correspond to different PEM electrolyzers under the same operating conditions.

[0149] The illustrative operational data includes key variables such as current density, output voltage, temperature, cathode pressure, anode pressure, and hydrogen production. Datasets A and C were collected under simple input conditions on two different electrolyzers (Equipment 1 and Equipment 2), while dataset B was collected under more complex input conditions on Equipment 1 only. More complex input conditions refer to operating conditions with significant fluctuations in input power.

[0150] An evaluation system incorporating classification accuracy, fault recall, and confusion matrix dispersion is established. A domain-aligned network model and fault diagnosis methods are used for multi-dimensional performance validation and evaluation, verifying the model's performance under different transfer tasks. Classification accuracy can be expressed as:

[0151]

[0152] in, This represents the number of correctly classified target domain samples. This indicates the total number of test samples in the target domain.

[0153] Migration Task 1: Based on the first target domain dataset B and the source domain dataset A, verify the performance of cross-conditional transfer.

[0154] Migration Task 2: Based on the second target domain dataset C and the source domain dataset A, verify the cross-device transfer performance.

[0155] Migration Task 3: Based on the second target domain dataset C and the source domain dataset A, verify the performance of cross-device reverse migration.

[0156] Experimental results are as follows Figure 2As shown in the figure, the transfer tasks from left to right are CNN, DDC, DAN, CORAL, MKML-MMD, and our model. Our model achieves an average accuracy of 98.89% in the A to B, A to C, and C to A tasks, which is significantly better than the baseline methods (CNN, DDC, etc.).

[0157] PEM electrolytic cell fault diagnosis steps:

[0158] Obtain the target domain dataset (target domain samples, unlabeled) and the source domain dataset (source domain samples and labels), and train the source domain fault diagnosis model based on the source domain dataset.

[0159] The source domain fault diagnosis model is used to process the source domain dataset and the target domain dataset respectively, resulting in the source domain feature vector set Fs and the target domain feature vector set Ft.

[0160] In the source domain, Fs is grouped by fault category based on the true label; in the target domain, Ft is grouped by the predicted pseudo-labels of the current model.

[0161] For each fault category, the optimal transmission sub-distance corresponding to the source domain feature distribution and the target domain feature distribution is calculated using the Sinkhorn algorithm.

[0162] The domain alignment loss is obtained by weighted summation of the distances of each optimal transporter.

[0163] Calculate the classification loss of the source domain, and combine it with the domain alignment loss and regularization loss to obtain the total loss function.

[0164] By minimizing the total loss function to update the model parameters, the model can be adapted to the target domain, thus obtaining a fault diagnosis model for the target domain.

[0165] The updated target domain fault diagnosis model is used to diagnose faults in the target domain dataset.

[0166] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0167] Please see Figure 3 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this specification.

[0168] like Figure 3As shown, the electronic device 300 may include at least one processor 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.

[0169] The communication bus 302 can be used to realize the connection and communication of the above components.

[0170] The user interface 303 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.

[0171] The network interface 304 may include, but is not limited to, Bluetooth modules, NFC modules, Wi-Fi modules, etc.

[0172] The processor 301 may include one or more processing cores. The processor 301 connects to various parts within the electronic device 300 using various interfaces and lines. It executes various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling data stored in the memory 305. Optionally, the processor 301 may be implemented using at least one hardware form selected from DSP, FPGA, and PLC. The processor 301 may integrate one or more of the following: CPU, GPU, and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip, without being integrated into the processor 301.

[0173] The memory 305 may include RAM or ROM. Optionally, the memory 305 may include a non-transitory computer-readable medium. The memory 305 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned processor 301. As a computer storage medium, the memory 305 may include an operating system, a network communication module, a user interface module, and a fault diagnosis application. The processor 301 may be used to call the fault diagnosis application stored in the memory 305 and execute the steps of the fault diagnosis method mentioned in the foregoing embodiments.

[0174] This specification also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform one or more steps in the above-described fault diagnosis method embodiments. If the constituent modules of the above-described electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.

[0175] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this specification is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0176] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementation can be combined arbitrarily.

[0177] The above embodiments are merely preferred embodiments described in this specification and are not intended to limit the scope of this specification. Any modifications and improvements made by those skilled in the art to the technical solutions of this specification without departing from the spirit of this specification should fall within the protection scope defined by the claims of this specification.

Claims

1. A method for diagnosing faults in a PEM electrolyzer, characterized in that, Includes the following steps: Obtain the source domain dataset, the target domain dataset, and the source domain fault diagnosis model obtained by training the model to be trained using the source domain dataset; Based on the source domain fault diagnosis model, feature extraction is performed on the source domain dataset and the target domain dataset respectively to obtain the source domain feature distribution corresponding to the source domain dataset and the target domain feature distribution corresponding to the target domain dataset. The source domain feature distribution represents the statistical characteristics of all feature vectors extracted from the source domain dataset, and the target domain feature distribution represents the statistical characteristics of all feature vectors extracted from the target domain dataset. The Sinkhorn algorithm is used to obtain the optimal transmission distance between the source domain feature distribution and the target domain feature distribution based on the source domain feature distribution and the target domain feature distribution; The loss function is calculated based on the optimal transmission distance, and the model parameters of the source domain fault diagnosis model are updated with minimizing the loss function as the update target to obtain the target domain fault diagnosis model. Fault diagnosis of target domain dataset is performed based on the target domain fault diagnosis model. The Sinkhorn algorithm includes an entropy regularization coefficient; The fault diagnosis method further includes: Based on the source domain fault diagnosis model, feature extraction is performed on the source domain dataset and the target domain dataset respectively to obtain the source domain feature vector set corresponding to the source domain dataset and the target domain feature vector set corresponding to the target domain dataset. The entropy regularization coefficient is updated based on the difference between the domain features of the source domain feature vector set and the target domain feature vector set. The loss function is a domain alignment loss function; the source domain dataset includes multiple source domain samples and their respective corresponding real fault labels, and the target domain dataset includes multiple target domain samples; The optimal transmission distance between the source domain feature distribution and the target domain feature distribution is obtained using the Sinkhorn algorithm, including: Based on the source domain fault diagnosis model, the pseudo fault label corresponding to each target domain sample in the target domain dataset is obtained. Both the real fault label and the pseudo fault label include multiple fault categories. For any fault category, the optimal transmission sub-distance between the source domain feature distribution and the target domain feature distribution corresponding to the fault category is obtained based on the source domain feature distribution and the target domain feature distribution; this step is repeated until the optimal transmission sub-distance corresponding to each fault category is obtained and the optimal transmission distance is formed. The loss function calculated based on the optimal transmission distance includes: The domain alignment loss function is calculated based on the optimal transmission sub-distance and preset weight value corresponding to each fault category.

2. The PEM electrolyzer fault diagnosis method according to claim 1, characterized in that, The optimal transmission distance between the source domain feature distribution and the target domain feature distribution is obtained using the Sinkhorn algorithm, including: Based on the source domain feature distribution and the target domain feature distribution, the Sinkhorn algorithm is used to obtain the first transmission distance characterizing the cross-domain transmission cost. Based on the source domain feature distribution, the Sinkhorn algorithm is used to obtain the second transmission distance characterizing the source domain self-transmission cost. The Sinkhorn algorithm is used to obtain the third transmission distance, which characterizes the self-transmission cost of the target domain, based on the target domain feature distribution. The optimal transmission distance is obtained based on the first transmission distance, the second transmission distance, and the third transmission distance.

3. The PEM electrolyzer fault diagnosis method according to claim 1, characterized in that, The loss function also includes classification loss and regularization loss.

4. The PEM electrolyzer fault diagnosis method according to claim 1, characterized in that, Each of the source domain samples and each of the target domain samples includes at least one of the following operating data: current density, output voltage, temperature, cathode pressure, anode pressure, and hydrogen production. The source domain fault diagnosis model extracts features from both the source domain dataset and the target domain dataset, including: An adaptive average pooling method is used to extract features from each source domain sample and each target domain sample.

5. The method for diagnosing faults in a PEM electrolyzer according to claim 1, characterized in that, The fault categories include no fault, abnormal thermal management fault, and electrolytic cell degradation fault; The acquisition of the source domain dataset and the target domain dataset includes: The duty cycle of the heaters in the PEM electrolyzers corresponding to the source and target domains was adjusted respectively to simulate abnormal thermal management faults. Degradation voltages were applied to the PEM electrolyzers corresponding to the source and target domains, respectively, to simulate electrolyzer degradation faults.

6. The PEM electrolyzer fault diagnosis method according to claim 1, characterized in that, The acquisition of the source domain dataset and the target domain dataset includes: Acquire multiple time-series data collected from the source and target domains respectively; Each time series data is divided into multiple overlapping windows of fixed length to obtain multiple data samples corresponding to each time series data. The source domain dataset is obtained by using all data samples of each time series data in the corresponding source domain, and the target domain dataset is obtained by using all data samples of each time series data in the corresponding target domain.

7. The PEM electrolyzer fault diagnosis method according to claim 6, characterized in that, The step of dividing each time series data into multiple overlapping windows of fixed length to obtain multiple data samples corresponding to each time series data further includes: Each data sample was normalized.

8. A domain-aligned network model architecture for applying the PEM electrolyzer fault diagnosis method as described in claim 1, characterized in that, This includes a feature extraction module using a one-dimensional convolutional neural network and a domain alignment module; The feature extraction module includes a multi-level progressive convolutional layer that extracts input data into high-dimensional feature vectors and a fault classification layer that reduces the high-dimensional feature vectors to obtain feature vectors of a preset dimension. The multi-level progressive convolutional layer includes an adaptive average pooling layer; The domain alignment module updates the model parameters using the Sinkhorn algorithm based on the preset dimension feature vector output by the fault classification layer.

Citation Information

Patent Citations

  • Transmission chain cross-domain diagnosis method for optimal transmission through fusion of zero-sequence current and vibration signals

    CN120873986A