A method for hydrogen fuel cell few-sample cross-condition fault diagnosis based on MAML

CN122964668APending Publication Date: 2026-10-23LIAONING UNIVERSITY OF TECHNOLOGY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611155889.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]本发明提供一种基于MAML的氢燃料电池少样本跨工况故障诊断方法,以克服现有技术因需要大量标注样本训练模型而导致的诊断准确率降低问题,以及多工况下诊断精度低下的问题

Benefits of technology

[0038]有益效果:本发明一种基于MAML的氢燃料电池少样本跨工况故障诊断方法通过模型无关元学习(MAML)框架,在多种典型工况的任务上进行元训练,使模型学到可快速适应新工况的优质初始参数;即便面对全新运行工况,也无需大规模重训或大量标注数据,仅靠少量新工况样本即可实现诊断模型的快速、精准迁移,有效解决了传统方法在工况变化时诊断性能急剧下降的痛点;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122964668A_ABST
    Figure CN122964668A_ABST
Patent Text Reader

Abstract

The application discloses a hydrogen fuel cell few-sample cross-condition fault diagnosis method based on MAML, comprising the following steps: collecting multi-source signals under multiple typical conditions, and constructing a multi-source signal dataset through pretreatment; constructing a source condition support set and a target condition query set by random sampling, forming a meta-training task set; constructing a learnable feature extraction network, introducing a model-independent meta-learning (MAML) framework for meta-training, and obtaining optimal initial parameters; for a new condition, only a small amount of multi-source signals are collected to construct a support set, and based on the optimal initial parameters, a limited number of gradient updates are performed to obtain network parameters under the new condition; and the adapted network is used for predicting the fault category of the new condition signal. The application can effectively solve the performance decline problem caused by data scarcity and condition migration in hydrogen fuel cell cross-condition fault diagnosis, and significantly improve the diagnosis accuracy and generalization ability of the new condition under the few-sample condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive hydrogen fuel cells, and more particularly to a method for fault diagnosis of hydrogen fuel cells with a small sample size across operating conditions based on MAML. Background Technology

[0002] Hydrogen fuel cells, as a highly efficient and clean energy conversion device, have broad application prospects in transportation, distributed power generation, and aerospace. However, fuel cell systems are complex in structure and highly coupled. In actual vehicle operation, hydrogen fuel cells are prone to malfunctions such as flooding and dehydration. If these issues are not addressed in time, they can lead to reduced battery performance or even hydrogen leaks and explosions, resulting in a series of operational safety and reliability problems. In view of this situation, research is needed on efficient and accurate fault diagnosis technologies for hydrogen fuel cells, which are directly related to their operating status and vehicle safety.

[0003] There are two main technical challenges in existing hydrogen fuel cell fault diagnosis technologies: First, there is a scarcity of fault samples. Hydrogen fuel cell vehicles cannot remain in a faulty state for extended periods, resulting in a limited amount of labeled fault data that can be collected. Traditional deep learning diagnostic methods rely on a large number of labeled samples to train the model, which significantly reduces the accuracy of the diagnosis. Second, the operating conditions are complex and varied. Hydrogen fuel cell vehicles experience various operating conditions during actual driving, such as low-temperature start-up and high-temperature hill climbing, leading to low diagnostic accuracy. Summary of the Invention

[0004] This invention provides a method for fault diagnosis of hydrogen fuel cells with few samples across operating conditions based on MAML, in order to overcome the problem of reduced diagnostic accuracy caused by the need for a large number of labeled samples to train the model in the existing technology, as well as the problem of low diagnostic accuracy under multiple operating conditions.

[0005] To achieve the above objectives, the technical solution of the present invention is as follows: A method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions, comprising: S1. Collect multi-source signals of hydrogen fuel cells under various typical operating conditions, and preprocess the multi-source signals to obtain three-dimensional tensor samples and the corresponding real labels of the three-dimensional tensors; construct a multi-source signal dataset based on the three-dimensional tensor samples and the corresponding real labels of the three-dimensional tensors. S2. Based on the multi-source signal dataset, obtain the support set of the source working conditions and the query set of the target working conditions through random sampling; construct the meta-training task set based on the support set of the source working conditions and the query set of the target working conditions. S3. Construct a learnable feature extraction network, and perform meta-training on the learnable feature extraction network using a model-independent meta-learning framework based on the meta-training task set to obtain the optimal initial parameters of the learnable feature extraction network. S4. Collect multi-source signals under the new working condition and construct the support set of the new working condition; according to the optimal initial parameters, perform a finite number of gradient updates through the support set of the new working condition to obtain parameters adapted to the new working condition, and then obtain a learnable feature extraction network adapted to the new working condition. S5. Based on the multi-source signals under the new operating conditions, obtain the three-dimensional tensor samples under the new operating conditions, and obtain the prediction results of the fault category based on the multi-source signals under the new operating conditions through a learnable feature extraction network adapted to the new operating conditions.

[0006] Furthermore, the structure of the multi-source signal dataset is as follows:

[0007] In the formula, This is a multi-source signal dataset; For the first A subset of data for various operating conditions; Index for operating conditions; This represents the total number of operating conditions. The subset dataset contains sample sets for several fault categories:

[0008] In the formula, For the first The set of all samples under normal conditions in a given working condition; For the first The set of all samples under the flooded state under various working conditions; For the first The set of all samples in the dehydrated state under various working conditions; For the first The set of all samples under air-starved conditions; For the first The set of all samples under hydrogen starvation conditions; Each sample set includes several 3D tensor samples and their corresponding labels:

[0009] In the formula, For the first The first working condition The set of all samples in a given state; For state category, and ; For the first j The first working condition The first of the sample sets of various fault states A three-dimensional tensor sample; For the first j The first working condition The first of the sample sets of various fault states The true label corresponding to each three-dimensional tensor sample.

[0010] Furthermore, the meta-training task set is represented as follows:

[0011] In the formula, For the meta-training task set; For the first Individual training tasks; For the first Individual training tasks; The number of meta-training tasks; The meta-training task is represented as follows:

[0012] In the formula, To support the set; For query set; To start from the source condition The Middle The first sample drawn from the sample set of the first state One sample; Indicates from the target working condition The Middle The first sample drawn from the sample set of the first state One sample; For the set of state categories, i.e. ; To support the number of samples for each type of fault in the central data; To query the number of samples for each type of fault in the set; To support the collection of samples for each type of fault; This is an index for samples of each type of fault in the query set.

[0013] Furthermore, the complete forward propagation process of the learnable feature extraction network can be represented as:

[0014] In the formula, The fault discrimination feature vector is output by the learnable feature extraction network; It is a learnable feature extraction network; It is a three-dimensional tensor sample; For global average pooling; For efficient channel attention; For depthwise separable convolution; For channel-dimensional splicing; The kernel size is One-dimensional convolution operation; The kernel size is One-dimensional convolution operation; The kernel size is One-dimensional convolution operation; This is a tensor shape transformation operation.

[0015] Furthermore, the specific steps for the learnable feature extraction network to generate the probability distributions of various faults are as follows: S31. Based on the three-dimensional tensor sample, the input feature vector sequence is obtained through tensor shape transformation operation, and the expression is:

[0016] In the formula, The input is a sequence of feature vectors; For height; Width; S32. Based on the input feature vector sequence, a multi-scale one-dimensional feature map is obtained through multi-scale parallel branches; The multi-scale parallel branches include small-scale convolution branches with a kernel size of 3, medium-scale convolution branches with a kernel size of 7, and large-scale convolution branches with a kernel size of 15. Specifically, based on the input feature vector sequence, a small-scale one-dimensional feature map is obtained through a small-scale convolution branch with a kernel size of 3, expressed as:

[0017] In the formula, This is a small-scale one-dimensional feature map; For activation functions; For batch normalization; For a one-dimensional convolution operation with a kernel size of 3 and 32 output channels; The kernel size for small-scale convolutional branches; This represents the number of output channels for the small-scale convolutional branch. Based on the input feature vector sequence, a medium-scale one-dimensional feature map is obtained through a medium-scale convolution branch with a kernel size of 7, expressed as:

[0018] In the formula, This is a mesoscale one-dimensional feature map; For a one-dimensional convolution operation with a kernel size of 7 and 32 output channels; The kernel size of the mesoscale convolution branch; This represents the number of output channels of the mesoscale convolutional branch. Based on the input feature vector sequence, a large-scale one-dimensional feature map is obtained through a large-scale convolution branch with a kernel size of 15, expressed as:

[0019] In the formula, This is a large-scale one-dimensional feature map; For a one-dimensional convolution operation with a kernel size of 15 and 32 output channels; The kernel size for large-scale convolutional branches; This represents the number of output channels for a large-scale convolutional branch. S33. Based on the small-scale one-dimensional feature map, the medium-scale one-dimensional feature map, and the large-scale one-dimensional feature map, a fused feature map is obtained through a concatenation operation, expressed as:

[0020] In the formula, To fuse feature maps; The length of the time series dimension; S34. Based on the fused feature map, a pointwise convolutional output feature map is obtained through depthwise separable convolution, expressed as:

[0021]

[0022] In the formula, The feature map output by channel-wise convolution; For one-dimensional depthwise separable convolution operations with a kernel size of 5; The feature map is output by pointwise convolution; For a one-dimensional depthwise separable convolution operation with 5 channels; This represents the kernel size for channel-wise convolution in depthwise separable convolution; This represents the number of output channels for a depthwise separable convolution. S35. Based on the pointwise convolution output feature map, pass it through the ECA attention module to obtain the weighted feature map, the expression of which is:

[0023] In the formula, This is the weighted feature map; Multiply by channels; The attention weights for each channel; S36. Based on the fused feature map and the weighted feature map, the residual-connected feature map is obtained through residual connections, and its expression is:

[0024] In the formula, This is the feature map after residual connection; S37. Based on the feature map after residual connection, the fault discrimination feature vector output by the learnable feature extraction network is obtained through global average pooling. The expression is:

[0025] In the formula, The dimension of the fault discrimination feature vector output by the learnable feature extraction network is... ; It is a time-series index; The length of the time series dimension; The fault discrimination feature vector is output by the learnable feature extraction network; S38. Based on the fault discrimination feature vector output by the learnable feature extraction network, the probability distribution of each type of fault is obtained through a linear classifier, expressed as:

[0026] In the formula, This represents the probability distribution of various types of faults; This is the weight matrix; This is a bias term.

[0027] Furthermore, the model-independent meta-learning framework includes an inner optimization mechanism and an outer optimization mechanism; The inner optimization mechanism is used to obtain the support set loss based on the support set in the meta-training task set through the cross-entropy loss equation of the inner optimization mechanism; and to obtain the task-specific parameter set based on the support set loss by performing gradient iterative optimization on the initial parameter set of the learnable feature extraction network. The outer optimization mechanism is used to obtain the query set loss based on the query set and task-specific parameter set in the meta-training task set, through the cross-entropy loss equation of the outer optimization mechanism; obtain the meta-loss through summation based on the query set loss; obtain the updated initial parameter set by differentiating the initial parameter set of the learnable feature extraction network with the meta-loss; obtain the outer gradient by gradient expansion of the updated initial parameter set; and iteratively update the initial parameter set of the learnable feature extraction network with the outer gradient until the meta-learning training converges, obtaining the optimal initial parameter set.

[0028] Furthermore, the expression for the cross-entropy loss equation of the inner optimization mechanism is as follows:

[0029] In the formula, To support the loss of the set; Number of fault categories; To support the number of samples for each type of fault in the centralization; To support a single training sample, where, For three-dimensional tensor samples, The true labels corresponding to the three-dimensional tensor samples; For the first Support set for individual training tasks; For a learnable feature extraction network to predict whether a sample belongs to the first... c The probability of a certain state; This is the initial parameter set for a learnable feature extraction network; The expression for the cross-entropy loss equation of the outer optimization mechanism is as follows:

[0030] In the formula, For query set loss; To query the number of samples for each type of fault in the set; For the first The query set of individual training tasks; A set of parameters specific to the task.

[0031] Furthermore, the expression for the task-specific parameter is:

[0032]

[0033] In the formula, For learnable feature extraction networks in the first... The set of task-specific parameters obtained after updating the inner layer of the individual training task; The inner learning rate; For gradient; For the linear classifier in the th Task-specific parameters obtained after updating the inner layer of the individual training task; These are the learnable parameters of a linear classifier; The expression for the optimal initial parameters is:

[0034] In the formula, The optimal set of initial parameters; For the distribution of meta-training tasks Mathematical expectation on; The distribution of training tasks is given.

[0035] Furthermore, the specific steps to obtain parameters adapted to the new operating conditions are as follows: S51. Collect several three-dimensional tensor samples from each state of the new working condition; S52. Based on several labeled samples, construct a new working condition support set, expressed as:

[0036] In the formula, Support set for new operating conditions; To adapt to new working conditions No. The sample of the first state is drawn from the sample set of the first state. One sample; Provide a centralized sample of each type of fault to support the new operating conditions; S53. Based on the new working condition support set, the loss of the new working condition support set is obtained through the cross-entropy loss equation of the inner optimization mechanism. S54. Based on the support set loss under the new working condition, the parameters adapted to the new working condition are obtained by performing a finite number of gradient updates on the optimal initial parameters. The expression is as follows:

[0037] In the formula, To adapt the parameters to the new operating conditions, To support the loss collection under new operating conditions.

[0038] Beneficial effects: The present invention provides a method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions. Through the Model Independent Meta-Learning (MAML) framework, meta-training is performed on tasks under various typical operating conditions, enabling the model to learn high-quality initial parameters that can quickly adapt to new operating conditions. Even when facing completely new operating conditions, there is no need for large-scale retraining or a large amount of labeled data. The diagnostic model can be quickly and accurately transferred with only a small number of new operating condition samples, which effectively solves the pain point of the traditional method where the diagnostic performance drops sharply when the operating conditions change. By collecting heterogeneous signals from multiple sources and preprocessing them into structured three-dimensional tensor samples, this multi-dimensional data fusion method, combined with tensor structure preservation, can more comprehensively and meticulously depict the subtle feature changes of fuel cells under different fault modes, providing richer and more robust inputs for subsequent meta-learning networks, thereby improving the accuracy of diagnosis and anti-interference ability. By designing a specialized "cross-condition sampling strategy", a meta-training task is constructed by reasonably dividing the support set of the source condition and the query set of the target condition. This strategy can effectively simulate real cross-condition migration scenarios, ensuring that the meta-training process can fully learn the general fault characteristics and rapid adaptation mechanisms under condition changes, avoiding training bias caused by unreasonable task construction, and further improving the stability of the model in actual deployment. To address the issues of scarce fault samples and high labeling costs in practical applications of hydrogen fuel cells, a "few-sample" learning mechanism based on meta-learning was designed. Under the target operating conditions, only a very small number of support set samples (i.e., few samples) are needed to complete the efficient adaptation of the model, which greatly reduces the dependence on massive amounts of labeled fault data and significantly reduces the data collection and labeling costs in engineering deployment. Attached Figure Description

[0039] 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 some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a flowchart illustrating the cross-operating condition fault diagnosis method of the present invention; Figure 2 This is a structural diagram of the fuel cell in a hydrogen fuel cell vehicle according to an embodiment of the present invention; Figure 3 This is a system block diagram of the cross-condition fault diagnosis method in an embodiment of the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] This embodiment provides a method for fault diagnosis of hydrogen fuel cells using a small sample size across operating conditions based on MAML, such as... Figure 1 and Figure 3 As shown, it includes: S1. Collect multi-source signals of hydrogen fuel cells under various typical operating conditions, and preprocess the multi-source signals to obtain three-dimensional tensor samples and the corresponding real labels of the three-dimensional tensors; construct a multi-source signal dataset based on the three-dimensional tensor samples and the corresponding real labels of the three-dimensional tensors. In this embodiment, the hydrogen fuel cell is as follows: Figure 2 As shown, its working process is as follows: under the action of the catalyst layer, hydrogen atoms are separated into hydrogen ions and electrons. The electrons supply power to the load through the external circuit. The hydrogen ions pass through the proton exchange membrane through the cathode and combine with the electrons flowing back to the cathode from the external circuit to generate water and release heat. Finally, chemical energy is converted into electrical energy.

[0043] In this embodiment, typical operating conditions during vehicle operation are selected, as shown in Table 1. Table 1 Typical Operating Conditions

[0044] Among them, the low temperature start-up condition is used to simulate the transient process of cold start-up in cold regions. The specific parameters are set to the ambient temperature being between the lowest temperature at which the hydrogen fuel cell can be successfully cold-started and the low temperature range above zero. The high-temperature ramp-up condition is used to simulate the continuous high-power output scenario in summer high temperature. The specific parameters are set as follows: the ambient temperature is in the high temperature range, the battery operating temperature is maintained at a high level by the water heating system, and the load change is constant and in the high load range. The rapid acceleration condition is used to simulate dynamic driving scenarios on urban roads, where the dynamic response of the gas supply system is lagging. The constant speed cruise mode is used to simulate steady-state operation on a highway, where the load changes are constant. The alternating hot and cold operating condition is used to simulate scenarios of drastic changes in ambient temperature or frequent battery start-stop, with the battery temperature alternating and cycling between low and high ranges. Under each of the above operating conditions, five states of operating data were collected, as shown in Table 2. Table 2 Five states

[0045] This includes N normal state, F1 flooding fault, F2 dehydration fault, F3 air starvation fault and F4 hydrogen starvation fault, as well as the simulation schemes for each state and their impact on the output voltage. Under safe and controllable conditions, it is not necessary to collect data for all five states under each working condition. Data for at least the normal state and at least two fault states should be collected according to the actual test conditions and training task requirements.

[0046] In this embodiment, the following sensor configuration scheme is used for synchronous acquisition of multi-source signals: Voltage signal acquisition: A voltage transformer connected to the positive and negative terminals of the battery monitors the battery's output voltage; Current signal acquisition: A Hall effect current sensor is used, and the detection device is installed in the main output circuit of the battery to detect the battery output current and load current; Temperature signal acquisition: Install a K-type thermocouple inside the battery near the proton exchange membrane to acquire the battery's operating temperature.

[0047] Specifically, the preprocessing includes wavelet adaptive threshold denoising, Z-score normalization, and sliding window reconstruction. The wavelet adaptive threshold denoising process analyzes the adaptive separation of multi-source signals and noise, removing high-frequency noise while preserving fault-related abrupt change information to the greatest extent possible; specifically as follows: Based on the multi-source signals, the detail coefficients of each level and the approximate coefficients of the final level are obtained through binary discrete wavelet transform, expressed as follows:

[0048] In the formula, It is a multi-source signal; This is the approximation coefficient for the lowest level; For detail coefficients at each level; This represents the total number of wavelet decomposition levels. Index for the number of decomposition levels; This is the index of the signal in a multi-source signal; For the first Time index of layer detail coefficients; Based on the detail coefficients of each layer, an adaptive thresholding function that combines soft and hard thresholding is used to process the data, resulting in the thresholded detail coefficients, expressed as follows:

[0049]

[0050] In the formula, For the first The detail coefficient of a layer after thresholding; This is a sign function; it takes the value 1 when the independent variable is greater than 0, -1 when it is less than 0, and 0 when it is equal to 0. There are two types of thresholds; The determination of the two types of thresholds relies on either the Stein unbiased risk estimation criterion or the general threshold rule, respectively, and their closed analytical forms can be derived using the [missing information - likely a specific method or technique]. Layer detail factor Noise standard deviation within Complete the estimation:

[0051] In the formula, The standard deviation of noise; The total number of signals in a multi-source signal; Based on the detail coefficients after thresholding and the approximation coefficients of the final level, the target signal for denoising is obtained through inverse discrete wavelet transform, expressed as:

[0052] In the formula, The target signal for noise reduction; For wavelet decomposition of the 1st Approximation coefficients of the layer; The first one after threshold processing Layer detail factor; The Z-score normalization process normalizes the target signal for denoising, and the expression is:

[0053] In the formula, For the normalized first The target signal to be denoised; The mean of the target signal sequence to be denoised; The labeled difference of the target signal sequence for denoising; With a mean of 0 and a standard deviation of 1, the following standard normal distribution sample is obtained:

[0054] ; The sliding window reconstruction process involves non-overlapping truncation of the standard normal distribution sample sequence, expressed as:

[0055] In the formula, For the first A segment of sample data, i.e., a length of [length missing] The timing signal segment; For the standard normally distributed sample sequence, the first... The value of each sampling point; For the first The starting position index of the capture window; The fixed window length is the number of sampling points contained in the truncated sample segment; The first normalized signal sequence k + + The value of one sampling point; This is the index of the extracted sample; In multi-source signal application scenarios, voltage signals acquired within the same time window can be processed. Current signal and temperature signal The data is then stitched together along the channel direction to construct a multi-channel time-series sample dataset.

[0056] In the formula, It is a voltage signal; It is a current signal; It is a temperature signal; To preserve the temporal neighborhood correlation of the signal, the one-dimensional multi-channel time-series signal is converted into a two-dimensional matrix form. For the first... A signal from a specific channel of a sample. A two-dimensional matrix is ​​constructed using a sliding window:

[0057] In the formula, For the first The two-dimensional feature matrix of a certain channel of a sample after being reconstructed by a sliding window; Among them, window width W and height H satisfy In this embodiment, it is preferred that... W =32, then Construct a dimension of ( A two-dimensional feature matrix of 31×32; Stacking the three-channel 2D matrices along the channel dimension yields the final sample tensor:

[0058] Each sample It is a three-dimensional tensor with three dimensions: number of channels (voltage, current, temperature), height (time step), and width (sliding window length).

[0059] Preferably, the structure of the multi-source signal dataset is as follows:

[0060] In the formula, This is a multi-source signal dataset; For the first A subset of data for various operating conditions; Index for operating conditions; This represents the total number of operating conditions. The subset dataset contains sample sets for several fault categories:

[0061] In the formula, For the first The set of all samples under normal conditions in a given working condition; For the first The set of all samples under the flooded state under various working conditions; For the first The set of all samples in the dehydrated state under various working conditions; For the first The set of all samples under air-starved conditions; For the first The set of all samples under hydrogen starvation conditions; Each sample set includes several 3D tensor samples and their corresponding labels:

[0062] In the formula, For the first The first working condition The set of all samples in a given state; It is a state category, and ; For the first j The first working condition The first of the sample sets of various fault states A three-dimensional tensor sample; For the first j The first working condition The first of the sample sets of various fault states The true label corresponding to each three-dimensional tensor sample.

[0063] Specifically, each subset of datasets The total number of samples is:

[0064] In the formula, For each sub-dataset The total number of three-dimensional tensor samples; Based on each sub-dataset The total number of samples determines the total sample size of the multi-source signal dataset constructed in this study:

[0065] In the formula, This represents the total sample size of the multi-source signal dataset. A hierarchical sampling strategy is used to divide the training set and the test set, so as to keep the distribution ratio of various fault samples under different working conditions in the training set and the test set balanced. The training set is used for subsequent meta-training process, and the test set is used to carry out the final diagnostic performance evaluation. In this embodiment, the number of samples for each operating condition and each fault category is no less than 500 to ensure sufficient sampling space when constructing the meta-training task. To achieve the above requirements, each fault state under each operating condition is collected in segments multiple times and then merged.

[0066] S2. Based on the multi-source signal dataset, obtain the support set of the source working conditions and the query set of the target working conditions through random sampling; construct the meta-training task set based on the support set of the source working conditions and the query set of the target working conditions. Preferably, the meta-training task set is represented as follows:

[0067] In the formula, For the meta-training task set; For the first Individual training tasks; For the first Individual training tasks; The number of meta-training tasks; The meta-training task is represented as follows:

[0068] In the formula, To support the set; For query set; To start from the source condition The Middle The sample of the first state is drawn from the sample set of the first state. One sample; Indicates from the target working condition The Middle The sample of the first state is drawn from the sample set of the first state. One sample; For the set of state categories, i.e. ; To support the number of samples for each type of fault in the centralization; To query the number of samples for each type of fault in the set; To support the collection of samples for each type of fault; This is an index for samples of each type of fault in the query set.

[0069] Specifically, for each meta-training task, source and target operating conditions are randomly selected from the operating conditions. A small number of labeled samples are extracted as support and query sets. The hydrogen fuel cell fault diagnosis problem with few samples across operating conditions is described as a C-class K-shot meta-training task with computable meta-loss. The meta-training task is defined as follows:

[0070] Wherein, the support set From the source working conditions The corresponding sample set Extraction K The support set is composed of samples, expressed as: ; The query set is in the target working condition The corresponding sample set Extraction Q These samples collectively constitute a query set covering different fault categories, expressed as: ; Repeat the above process of extracting the support set and query set (preferably). ), thus obtaining the meta-training task set.

[0071] In this embodiment, a minimum sample retention rate is set for each operating condition and state category. Construct validation and test sets with the following preset conditions:

[0072] In the formula, This indicates the number of samples reserved for the validation and test sets for each work condition-category combination.

[0073] In this embodiment, the meta-training task set The complete construction process is shown in the following steps: Input: Dataset Number of categories C The number of valid labeled samples for each type of fault in the support set. K Number of samples per class in the query set Q Total number of tasks ; Output: Meta-training task set ; 1. Initialization ; 2. For arrive implement: 3. From Random selection without replacement , ,satisfy ; 4. From Random selection without replacement C There are 1 category, denoted as ; 5. , ; 6. For each implement: 7. From Random selection without replacement K One sample, added ; 8. From Random selection without replacement K One sample, added ; 9. End the loop; 10. , ; 11. End the loop; 12. Return .

[0074] S3. Construct a learnable feature extraction network, and perform meta-training on the learnable feature extraction network using a model-independent meta-learning framework based on the meta-training task set to obtain the optimal initial parameters of the learnable feature extraction network. Preferably, the complete forward propagation process of the learnable feature extraction network can be represented as:

[0075] In the formula, The fault discrimination feature vector is output by the learnable feature extraction network; It is a learnable feature extraction network; It is a three-dimensional tensor sample; For global average pooling; For efficient channel attention; For depthwise separable convolution; For channel-dimensional splicing; The kernel size is One-dimensional convolution operation; The kernel size is One-dimensional convolution operation; The kernel size is One-dimensional convolution operation; This is a tensor shape transformation operation.

[0076] Preferably, the specific steps for the learnable feature extraction network to generate probability distributions for various faults are as follows: S31. Based on the three-dimensional tensor sample, the input feature vector sequence is obtained through tensor shape transformation operation, and the expression is:

[0077] In the formula, The input is a sequence of feature vectors; For height; Width; S32. Because the hydrogen fuel cell flooding fault causes high-frequency voltage fluctuations (with a period of 2 to 5 seconds) and the dehydration fault causes slow drift (with a period of tens to hundreds of seconds), and a single-scale convolution kernel cannot capture the above multi-scale features at the same time, this invention uses three different sizes of convolution kernels to extract them in parallel. Based on the input feature vector sequence, a multi-scale one-dimensional feature map is obtained through multi-scale parallel branches; The multi-scale parallel branches include small-scale convolution branches with a kernel size of 3, medium-scale convolution branches with a kernel size of 7, and large-scale convolution branches with a kernel size of 15. Specifically, based on the input feature vector sequence, a small-scale one-dimensional feature map is obtained through a small-scale convolution branch with a kernel size of 3, expressed as:

[0078] In the formula, This is a small-scale one-dimensional feature map; For activation functions; For batch normalization; For a one-dimensional convolution operation with a kernel size of 3 and 32 output channels; The kernel size for small-scale convolutional branches; This represents the number of output channels for the small-scale convolutional branch. Based on the input feature vector sequence, a medium-scale one-dimensional feature map is obtained through a medium-scale convolution branch with a kernel size of 7. The expression is as follows:

[0079] In the formula, This is a mesoscale one-dimensional feature map; For a one-dimensional convolution operation with a kernel size of 7 and 32 output channels; The kernel size of the mesoscale convolution branch; This represents the number of output channels of the mesoscale convolutional branch. Based on the input feature vector sequence, a large-scale one-dimensional feature map is obtained through a large-scale convolution branch with a kernel size of 15, expressed as:

[0080] In the formula, This is a large-scale one-dimensional feature map; For a one-dimensional convolution operation with a kernel size of 15 and 32 output channels; The kernel size for large-scale convolutional branches; This represents the number of output channels for a large-scale convolutional branch. S33. Based on the small-scale one-dimensional feature map, the medium-scale one-dimensional feature map, and the large-scale one-dimensional feature map, a fused feature map is obtained through a concatenation operation, expressed as:

[0081] In the formula, To fuse feature maps; The length of the time series dimension; S34. Based on the fused feature map, a pointwise convolutional output feature map is obtained through depthwise separable convolution, expressed as:

[0082]

[0083] In the formula, The feature map output by channel-wise convolution; For one-dimensional depthwise separable convolution operations with a kernel size of 5; The feature map is output by pointwise convolution; For a one-dimensional depthwise separable convolution operation with 5 channels; This represents the kernel size for channel-wise convolution in depthwise separable convolution. This represents the number of output channels for a depthwise separable convolution. S35. Based on the pointwise convolution output feature map, pass it through the ECA attention module to obtain the weighted feature map, the expression of which is:

[0084] In the formula, This is the weighted feature map; Multiply by channels; The attention weights for each channel; Specifically, the steps to obtain the attention weights for each channel are as follows: S351. Based on the feature map output by pointwise convolution, the average pooling vector is obtained by global average pooling of the channels. The expression is:

[0085] In the formula, This is the average pooling vector; It is a time-series index; For channel indexing; S352. Based on the average pooling vector, the attention weight vector for each channel is obtained through a one-dimensional convolution operation, expressed as:

[0086] In the formula, The attention weights for each channel; Use the Sigmoid activation function; The kernel size is One-dimensional convolution operation; The convolution kernel size Capable of targeting channel capacity To make an adaptive adjustment, the expression is:

[0087] In the formula, This is the bias constant; To take the nearest odd number; To take the nearest odd number; S36. Based on the fused feature map and the weighted feature map, the residual-connected feature map is obtained through residual connections, and its expression is:

[0088] In the formula, This is the feature map after residual connection; S37. Based on the feature map after residual connection, the fault discrimination feature vector output by the learnable feature extraction network is obtained through global average pooling. The expression is:

[0089] In the formula, The dimension of the fault discrimination feature vector output by the learnable feature extraction network is... ; It is a time-series index; The length of the time series dimension; The fault discrimination feature vector is output by the learnable feature extraction network; Among them, dimension The value is 64; S38. Based on the fault discrimination feature vector output by the learnable feature extraction network, the probability distribution of each type of fault is obtained through a linear classifier, expressed as:

[0090] In the formula, This represents the probability distribution of various types of faults; This is the weight matrix; This is a bias term.

[0091] In this embodiment, the initial parameter set of the learnable feature extraction network includes:

[0092] In the formula, This is the initial parameter set for a learnable feature extraction network; For small-scale convolutional branches ( Trainable parameters of ) For mesoscale convolutional branches ( Trainable parameters of ) For large-scale convolutional branches ( Trainable parameters of ) These are the trainable parameters for channel-wise convolution in depthwise separable convolution; These are the trainable parameters for pointwise convolution in depthwise separable convolution; These are the trainable parameters for an efficient channel attention module; These are the trainable parameters for the batch normalization layer.

[0093] Preferably, the model-independent meta-learning framework includes an inner optimization mechanism and an outer optimization mechanism; The inner optimization mechanism is used to obtain the support set loss based on the support set in the meta-training task set through the cross-entropy loss equation of the inner optimization mechanism; and to obtain the task-specific parameter set based on the support set loss by performing gradient iterative optimization on the initial parameter set of the learnable feature extraction network. The outer optimization mechanism is used to obtain the query set loss based on the query set and task-specific parameter set in the meta-training task set, through the cross-entropy loss equation of the outer optimization mechanism; obtain the meta-loss through summation based on the query set loss; obtain the updated initial parameter set by differentiating the initial parameter set of the learnable feature extraction network with the meta-loss; obtain the outer gradient by gradient expansion of the updated initial parameter set; and iteratively update the initial parameter set of the learnable feature extraction network with the outer gradient until the meta-learning training converges, obtaining the optimal initial parameter set.

[0094] Preferably, the expression for the cross-entropy loss equation of the inner optimization mechanism is:

[0095] In the formula, To support the loss of the set; Number of fault categories; To support the number of samples for each type of fault in the centralization; To support a single training sample, where, For three-dimensional tensor samples, The true labels corresponding to the three-dimensional tensor samples; For the first Support set for individual training tasks; For a learnable feature extraction network to predict whether a sample belongs to the first... c The probability of a certain state; This is the initial parameter set for a learnable feature extraction network; The expression for the cross-entropy loss equation of the outer optimization mechanism is as follows:

[0096] In the formula, For query set loss; To query the number of samples for each type of fault in the set; For the first The query set of individual training tasks; A set of parameters specific to the task.

[0097] Preferably, the expression for the task-specific parameter is:

[0098]

[0099] In the formula, For learnable feature extraction networks in the first... The set of task-specific parameters obtained after updating the inner layer of the individual training task; The inner learning rate; For gradient; For the linear classifier in the th Task-specific parameters obtained after updating the inner layer of the individual training task; These are the learnable parameters of a linear classifier; The expression for the optimal initial parameters is:

[0100] In the formula, The optimal set of initial parameters; For the distribution of meta-training tasks Mathematical expectation on; The distribution of training tasks is given.

[0101] Specifically, the inner and outer optimization mechanisms of the model-independent meta-learning framework determine the task probability distribution. The global optimization objective is then: .

[0102] Specifically, the expression for the meta-loss is:

[0103] In the formula, For a loss of RMB; This is the set of tasks sampled in the current batch, with a preferred batch size of 32. The expression for updating the initial parameters is:

[0104] In the formula, The differential symbol; The outer learning rate is preferably set to 0.001 in this embodiment; For parameters The differential; The expression for the outer gradient is:

[0105] Since this gradient calculation involves the second derivative (Hessian matrix), to reduce computational complexity, this embodiment preferably uses a first-order approximation MAML (FOMAML), ignoring the second derivative term: .

[0106] S4. Collect multi-source signals under the new working condition and construct the support set of the new working condition; according to the optimal initial parameters, perform a finite number of gradient updates through the support set of the new working condition to obtain parameters adapted to the new working condition, and then obtain a learnable feature extraction network adapted to the new working condition. Preferably, the specific steps to obtain parameters adapted to the new operating conditions are as follows: S51. Collect several three-dimensional tensor samples from each state of the new working condition; S52. Based on several labeled samples, construct a new working condition support set, expressed as:

[0107] In the formula, Support set for new operating conditions; To adapt to new working conditions No. The sample of the first state is drawn from the sample set of the first state. One sample; Provide a centralized sample of each type of fault to support the new operating conditions; S53. Based on the new working condition support set, the loss of the new working condition support set is obtained through the cross-entropy loss equation of the inner optimization mechanism. The expression for the support set loss under the new operating condition is:

[0108] In the formula, The number of fault categories included in the meta-training task under the new operating conditions; S54. Based on the support set loss under the new working condition, the parameters adapted to the new working condition are obtained by performing a finite number of gradient updates on the optimal initial parameters. The expression is as follows:

[0109] In the formula, To adapt the parameters to the new operating conditions, To support the loss collection in the new operating conditions; In this embodiment, the finite number of times is set to 3.

[0110] S5. Based on the multi-source signals under the new operating conditions, obtain the three-dimensional tensor samples under the new operating conditions, and obtain the prediction results of the fault category based on the multi-source signals under the new operating conditions through a learnable feature extraction network adapted to the new operating conditions.

[0111] In this embodiment, parameters adapted to the new operating condition are applied to a learnable feature extraction network to obtain a learnable feature extraction network adapted to the new operating condition. Unlabeled real-time data under the new operating condition is input into the learnable feature extraction network adapted to the new operating condition and a linear classifier, and the predicted result corresponding to the fault category is output, expressed as:

[0112] In the formula, The prediction results are for the corresponding fault categories; For linear classifiers; A learnable feature extraction network adapted to new working conditions; This is for label-free real-time data under new operating conditions; With the help of meta-test task sets To objectively evaluate the model's diagnostic performance across a small number of working conditions, each meta-test task... The support set in the model is used to simulate the new operating conditions. K A set of labeled samples is used to calculate the diagnostic accuracy for this task. The model's diagnostic accuracy is:

[0113] In the formula, For the first Diagnostic accuracy of individual test tasks; When the predicted classification result output by the learnable feature extraction network adapted to the new working conditions completely matches the true label of the sample, the indicator function takes the value of 1; if the two do not match, the function output is 0.

[0114] In this embodiment, to verify the effectiveness of the cross-operating condition fault diagnosis method, an experimental verification scheme is designed. The specific technical solution is as follows: A PEMFC single-cell test platform was built for experimental verification. The test platform was equipped with an electronic load (power range 0~165W, voltage resolution ≥1mV, sampling frequency 10Hz). In the experiment, hydrogen with a purity of 99.999% was introduced into the anode of the fuel cell, and compressed air that had been dried and filtered was used at the cathode. The gas metering ratio of the anode and cathode was set to 1.5 and 3.5 respectively under normal operating conditions. Based on Table 1, five typical operating conditions of hydrogen fuel cell vehicles during actual driving were selected to simulate battery operating conditions and fault states. According to the fault categories in Table 2, five types of state data were collected under each operating condition. The data acquisition adopted the sensor configuration scheme described above. All sensor data were collected synchronously through the CAN bus and sent to the vehicle controller at a sampling frequency of 10Hz. In this process, no less than 500 samples are collected for each state under each working condition to construct a multi-condition fault dataset containing 5 working conditions × 5 health states, with a total number of no less than 12,500 samples. Each sample contains time-series signals of three channels: voltage, current, and temperature. After preprocessing, the signals are converted into three-dimensional tensor samples. The source working condition is randomly selected from five working conditions. With the target working condition Randomly selected from five states C Types (C =3 or 4), extract from each class of the sample set corresponding to the source working condition. K One sample ( K The support set consists of samples of type 1, 3, 5, 10, and samples are drawn from each class of the sample set corresponding to the target working condition. Q One sample ( Q =15) constitute the query set, and the structure is repeated. Individual training tasks, separately constructed Individual verification tasks and Individual test tasks; To ensure a comprehensive evaluation of the model's generalization ability across operating conditions, the following meta-test tasks were designed: (1) Develop tests for known working condition combinations. The combination of source working condition and target working condition has appeared in the meta-training stage and is used to evaluate the diagnostic performance of the model in known cross-working condition scenarios. (2) Design tests for unfamiliar working condition combinations. The combination of source and target working conditions has never appeared in the meta-training stage and is used to evaluate the model’s generalization ability when facing new cross-working condition scenarios. To verify the effectiveness of the method of the present invention, the following method was used to design the experiment: (1) Using the traditional CNN method, a standard one-dimensional convolutional neural network with the same number of layers as the learnable feature extraction network is used. The MAML meta-learning framework is not used. The training is performed directly on the source working condition data and tested on the target working condition. (2) Conventional transfer learning methods are used to perform cross-condition transfer diagnosis using domain adversarial neural networks, without using meta-learning mechanisms; (3) Single-scale CNN+MAML uses only single-scale convolutional kernels. k =7) to replace the multi-scale parallel branch in the learnable feature extraction network, and remove the ECA attention module; the rest of the structure is the same as the learnable feature extraction network. (4) Perform steps S1 to S5 and use the average diagnostic accuracy of the meta-test task. As the main evaluation indicator:

[0115] In the formula, The average diagnostic accuracy of the meta-test task; For the first Diagnostic accuracy of individual test tasks; The number of meta-test tasks; This serves as the index for the meta-test task; To verify the contribution of each module in this invention, the following ablation experiment was designed: (1) Ablate the multi-scale convolutional modules, and separate the small-scale convolutional branches ( k 1=3), mesoscale convolutional branches ( k 2=7) and large-scale convolution branches ( k Remove 3=15) and observe the contribution of each scale feature to the diagnostic accuracy to verify the necessity of parallel extraction of multi-scale features by three sizes of convolution kernels as described in S32 of this invention. (2) Ablation of the attention module was performed to remove the ECA high-efficiency channel attention module and verify the effect of the attention mechanism on the feature discrimination ability. (3) Ablation of the meta-learning framework: remove the MAML meta-training framework in S4 and directly use traditional supervised learning to train the feature extraction network to verify the effectiveness of meta-learning in scenarios with few samples and cross-conditions. The steps of the verification experiment are as follows: (1) Data acquisition and preprocessing: Multi-source signals of five types of states were collected under five typical working conditions, and were processed by wavelet adaptive threshold denoising, Z-score normalization and sliding window reconstruction in sequence, and a multi-source signal dataset was constructed. (2) Construction of meta-training task set and model training: Construct meta-training task set according to step S2, construct learnable feature extraction network according to step S3, and then perform meta-training through MAML framework according to step S4 to obtain optimal initial parameters. ; (3) Rapid adaptation testing with few samples: According to step S5, for each meta-test task, the support set of that task is used ( K =1,3,5,10) from the optimal initial parameters The process begins with a three-step gradient update to obtain the adapted model parameters, and then the diagnostic accuracy is calculated on the query set. ; (4) Comparative analysis and statistical results: Each comparative method and ablation experiment configuration was run separately, and the results of each method at different levels were recorded. K Average diagnostic accuracy at values The performance advantages of the cross-condition fault diagnosis method in this embodiment are statistically compared and analyzed. Experimental results show that the cross-condition fault diagnosis method in this embodiment is effective with a small sample size. KUnder condition 5, the diagnostic accuracy of the multi-condition and fault diagnosis method is significantly better than that of traditional CNN methods and conventional transfer learning methods, indicating the effectiveness of the MAML meta-learning framework in fault diagnosis of hydrogen fuel cells with few samples across operating conditions. When tested with completely unfamiliar operating condition combinations, the diagnostic accuracy of the fault diagnosis method of this embodiment is still high, verifying the model's generalization ability for cross-condition scenarios. The ablation experiment results show that the multi-scale convolution module ECA attention module and the MAML meta-learning framework each contribute to the performance improvement.

[0116] The present invention has the following beneficial effects: This invention presents a method for fault diagnosis of hydrogen fuel cells based on Model-Independent Meta-Learning (MAML) with few samples across operating conditions. Through the Model-Independent Meta-Learning (MAML) framework, meta-training is performed on tasks under various typical operating conditions, enabling the model to learn high-quality initial parameters that can quickly adapt to new operating conditions. Even when facing completely new operating conditions, there is no need for large-scale retraining or a large amount of labeled data. The diagnostic model can be quickly and accurately transferred with only a small number of new operating condition samples, effectively solving the pain point of the traditional method where the diagnostic performance drops sharply when the operating conditions change. By collecting heterogeneous signals from multiple sources and preprocessing them into structured three-dimensional tensor samples, this multi-dimensional data fusion method, combined with tensor structure preservation, can more comprehensively and meticulously depict the subtle feature changes of fuel cells under different fault modes, providing richer and more robust inputs for subsequent meta-learning networks, thereby improving the accuracy of diagnosis and anti-interference ability. By designing a specialized "cross-condition sampling strategy", a meta-training task is constructed by reasonably dividing the support set of the source condition and the query set of the target condition. This strategy can effectively simulate real cross-condition migration scenarios, ensuring that the meta-training process can fully learn the general fault characteristics and rapid adaptation mechanisms under condition changes, avoiding training bias caused by unreasonable task construction, and further improving the stability of the model in actual deployment. To address the issues of scarce fault samples and high labeling costs in practical applications of hydrogen fuel cells, a "few-sample" learning mechanism based on meta-learning was designed. Under the target operating conditions, only a very small number of support set samples (i.e., few samples) are needed to complete the efficient adaptation of the model, which greatly reduces the dependence on massive amounts of labeled fault data and significantly reduces the data collection and labeling costs in engineering deployment.

[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for fault diagnosis of hydrogen fuel cells with a small sample size across operating conditions based on MAML, characterized in that, include: S1. Collect multi-source signals of hydrogen fuel cells under various typical operating conditions, and preprocess the multi-source signals to obtain three-dimensional tensor samples and the real labels corresponding to the three-dimensional tensors. Construct a multi-source signal dataset based on 3D tensor samples and their corresponding real labels; S2. Based on the multi-source signal dataset, obtain the support set of the source conditions and the query set of the target conditions through random sampling. Based on the support set of the source working conditions and the query set of the target working conditions, a meta-training task set is constructed; S3. Construct a learnable feature extraction network, and perform meta-training on the learnable feature extraction network using a model-independent meta-learning framework based on the meta-training task set to obtain the optimal initial parameters of the learnable feature extraction network. S4. Collect multi-source signals under the new working condition and construct the support set of the new working condition; according to the optimal initial parameters, perform a finite number of gradient updates through the support set of the new working condition to obtain parameters adapted to the new working condition, and then obtain a learnable feature extraction network adapted to the new working condition. S5. Based on the multi-source signals under the new operating conditions, obtain the three-dimensional tensor samples under the new operating conditions, and obtain the prediction results of the fault category based on the multi-source signals under the new operating conditions through a learnable feature extraction network adapted to the new operating conditions.

2. The method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions according to claim 1, characterized in that, The structure of the multi-source signal dataset is as follows: In the formula, This is a multi-source signal dataset; For the first A subset of data for various operating conditions; Index for operating conditions; The total number of operating conditions; The subset dataset contains sample sets for several fault categories: In the formula, For the first The set of all samples under normal conditions in a given working condition; For the first The set of all samples under the flooded state under various working conditions; For the first The set of all samples in the dehydrated state under various working conditions; For the first The set of all samples under air-starved conditions; For the first The set of all samples under hydrogen starvation conditions; Each sample set includes several 3D tensor samples and their corresponding labels: In the formula, For the first The first working condition The set of all samples in a given state; For state category, and ; For the first j The first working condition The first of the sample sets of various fault states A three-dimensional tensor sample; For the first j The first working condition The first of the sample sets of various fault states The true label corresponding to each three-dimensional tensor sample.

3. The method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions according to claim 2, characterized in that, The meta-training task set is represented as follows: In the formula, For the meta-training task set; For the first Individual training tasks; For the first Individual training tasks; The number of meta-training tasks; The meta-training task is represented as follows: In the formula, To support the set; For query set; To start from the source condition The Middle The first sample drawn from the sample set of the first state One sample; Indicates from the target working condition The Middle The first sample drawn from the sample set of the first state One sample; For the set of state categories, i.e. ; To support the number of samples for each type of fault in the central data; To query the number of samples for each type of fault in the set; To support the collection of samples for each type of fault; This is an index for samples of each type of fault in the query set.

4. The method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions according to claim 1, characterized in that, The complete forward propagation process of the learnable feature extraction network can be represented as follows: In the formula, The fault discrimination feature vector is output by the learnable feature extraction network; It is a learnable feature extraction network; It is a three-dimensional tensor sample; For global average pooling; For efficient channel attention; For depthwise separable convolution; For channel-dimensional splicing; The kernel size is One-dimensional convolution operation; The kernel size is One-dimensional convolution operation; The kernel size is One-dimensional convolution operation; This is a tensor shape transformation operation.

5. The method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions according to claim 4, characterized in that, The specific steps for the learnable feature extraction network to generate probability distributions for various faults are as follows: S31. Based on the three-dimensional tensor sample, the input feature vector sequence is obtained through tensor shape transformation operation, and the expression is: In the formula, The input is a sequence of feature vectors; For height; Width; S32. Based on the input feature vector sequence, a multi-scale one-dimensional feature map is obtained through multi-scale parallel branches; The multi-scale parallel branches include small-scale convolution branches with a kernel size of 3, medium-scale convolution branches with a kernel size of 7, and large-scale convolution branches with a kernel size of 15. Specifically, based on the input feature vector sequence, a small-scale one-dimensional feature map is obtained through a small-scale convolution branch with a kernel size of 3, expressed as: In the formula, This is a small-scale one-dimensional feature map; For activation functions; For batch normalization; For a one-dimensional convolution operation with a kernel size of 3 and 32 output channels; The kernel size for small-scale convolutional branches; This represents the number of output channels for the small-scale convolutional branch. Based on the input feature vector sequence, a medium-scale one-dimensional feature map is obtained through a medium-scale convolution branch with a kernel size of 7, expressed as: In the formula, This is a mesoscale one-dimensional feature map; For a one-dimensional convolution operation with a kernel size of 7 and 32 output channels; The kernel size of the mesoscale convolution branch; This represents the number of output channels of the mesoscale convolutional branch. Based on the input feature vector sequence, a large-scale one-dimensional feature map is obtained through a large-scale convolution branch with a kernel size of 15, expressed as: In the formula, This is a large-scale one-dimensional feature map; For a one-dimensional convolution operation with a kernel size of 15 and 32 output channels; The kernel size for large-scale convolutional branches; This represents the number of output channels for a large-scale convolutional branch. S33. Based on the small-scale one-dimensional feature map, the medium-scale one-dimensional feature map, and the large-scale one-dimensional feature map, a fused feature map is obtained through a concatenation operation, expressed as: In the formula, To fuse feature maps; The length of the time series dimension; S34. Based on the fused feature map, a pointwise convolutional output feature map is obtained through depthwise separable convolution, expressed as: In the formula, The feature map output by channel-wise convolution; For one-dimensional depthwise separable convolution operations with a kernel size of 5; The feature map is output by pointwise convolution; For a one-dimensional depthwise separable convolution operation with 5 channels; This represents the kernel size for channel-wise convolution in depthwise separable convolution. This represents the number of output channels for a depthwise separable convolution. S35. Based on the pointwise convolution output feature map, pass it through the ECA attention module to obtain the weighted feature map, the expression of which is: In the formula, This is the weighted feature map; Multiply by channels; The attention weights for each channel; S36. Based on the fused feature map and the weighted feature map, the residual-connected feature map is obtained through residual connections, and its expression is: In the formula, This is the feature map after residual connection; S37. Based on the feature map after residual connection, the fault discrimination feature vector output by the learnable feature extraction network is obtained through global average pooling. The expression is: In the formula, The dimension of the fault discrimination feature vector output by the learnable feature extraction network is... ; It is a time-series index; The length of the time series dimension; The fault discrimination feature vector is output by the learnable feature extraction network; S38. Based on the fault discrimination feature vector output by the learnable feature extraction network, the probability distribution of each type of fault is obtained through a linear classifier, expressed as: In the formula, This represents the probability distribution of various types of faults; This is the weight matrix; This is a bias term.

6. The method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions according to claim 1, characterized in that, The model-independent meta-learning framework includes an inner optimization mechanism and an outer optimization mechanism; The inner optimization mechanism is used to obtain the support set loss based on the support set in the meta-training task set through the cross-entropy loss equation of the inner optimization mechanism; and to obtain the task-specific parameter set based on the support set loss by performing gradient iterative optimization on the initial parameter set of the learnable feature extraction network. The outer optimization mechanism is used to obtain the query set loss based on the query set and task-specific parameter set in the meta-training task set, through the cross-entropy loss equation of the outer optimization mechanism; obtain the meta-loss through summation based on the query set loss; obtain the updated initial parameter set by differentiating the initial parameter set of the learnable feature extraction network with the meta-loss; obtain the outer gradient by gradient expansion of the updated initial parameter set; and iteratively update the initial parameter set of the learnable feature extraction network with the outer gradient until the meta-learning training converges, obtaining the optimal initial parameter set.

7. The method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions according to claim 6, characterized in that, The expression for the cross-entropy loss equation of the inner optimization mechanism is as follows: In the formula, To support the loss of the set; Number of fault categories; To support the number of samples for each type of fault in the centralization; To support a single training sample, where, For three-dimensional tensor samples, The true labels corresponding to the three-dimensional tensor samples; For the first Support set for individual training tasks; For a learnable feature extraction network to predict whether a sample belongs to the first... c The probability of a certain state; This is the initial parameter set for a learnable feature extraction network; The expression for the cross-entropy loss equation of the outer optimization mechanism is as follows: In the formula, For query set loss; To query the number of samples for each type of fault in the set; For the first A query set for individual training tasks; A set of parameters specific to the task.

8. A method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions, as described in claim 6 or 7, characterized in that, The expression for the task-specific parameter is: In the formula, For learnable feature extraction networks in the first... The set of task-specific parameters obtained after updating the inner layer of the individual training task; The inner learning rate; For gradient; For the linear classifier in the th Task-specific parameters obtained after updating the inner layer of the individual training task; These are the learnable parameters of a linear classifier; The expression for the optimal initial parameters is: In the formula, The optimal set of initial parameters; For the distribution of meta-training tasks Mathematical expectation on; The distribution of training tasks is given.

9. The method for fault diagnosis of hydrogen fuel cells based on MAML with few samples across operating conditions according to claim 8, characterized in that, The specific steps to obtain parameters adapted to the new operating conditions are as follows: S51. Collect several three-dimensional tensor samples from each state of the new working condition; S52. Based on several labeled samples, construct a new working condition support set, expressed as: In the formula, Support set for new operating conditions; To adapt to new working conditions No. The sample of the first state is drawn from the sample set of the first state. One sample; Provide a centralized sample of each type of fault to support the new operating conditions; S53. Based on the new working condition support set, the loss of the new working condition support set is obtained through the cross-entropy loss equation of the inner optimization mechanism. S54. Based on the support set loss under the new working condition, the parameters adapted to the new working condition are obtained by performing a finite number of gradient updates on the optimal initial parameters. The expression is as follows: In the formula, To adapt the parameters to the new operating conditions, To support the loss collection under new operating conditions.