Fuel cell fault diagnosis method and system based on deformable convolution residual attention

Through the KAN model with deformable convolutional residual attention enhancement, combined with QTSE and DTW loss functions, the problem of low accuracy in fuel cell fault diagnosis is solved, and higher fault detection accuracy and reliability are achieved.

CN120385933APending Publication Date: 2025-07-29深能智慧能源科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510596959.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

The existing fuel cell fault diagnosis methods have the problem of low accuracy of fault diagnosis, especially due to insufficient accuracy caused by irregular changes in battery input data.

Method used

A KAN model with deformable convolution residual attention enhancement is adopted, combined with deformable convolution, residual attention mechanism and two KAN layers, and is trained using a combination of QTSE and DTW loss function to enhance data correlation and fault diagnosis accuracy.

Benefits of technology

Improves the accuracy and reliability of fuel cell failure detection, can predict faults earlier, and reduces the potential risks caused by hysteresis diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120385933A_ABST
    Figure CN120385933A_ABST
Patent Text Reader

Abstract

The invention discloses a fuel cell fault diagnosis method and system based on deformable convolution residual attention, relates to the technical field of fuel cell detection, and aims to solve the problem that an existing fuel cell fault diagnosis method is low in fault diagnosis accuracy. According to the method, the input data is processed by using the combination of the QTSE loss function for giving greater penalty to the lag prediction and the DTW loss function for enhancing the correlation and combining the deformable convolution residual attention mechanism and the KAN network, so that the correlation between the data is enhanced, irregular changes of the input data of the battery are reduced, and the accuracy of the battery is improved. Therefore, the existing fuel cell fault diagnosis method is low in fault diagnosis accuracy. According to the technical scheme, the accuracy and reliability of fuel cell fault detection are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fuel cell detection, and specifically to a fuel cell fault diagnosis method and system based on deformable convolutional residual attention. Background Art

[0002] With the continuous growth of global energy demand and the enhancement of environmental protection awareness, fuel cells, as an efficient and clean energy conversion technology, have received extensive attention and applications in recent years. With its advantages of high energy conversion efficiency, environmental friendliness, low operating temperature, and fast startup speed, it shows unique application potential in fields such as fixed / portable power generation, transportation, and aerospace. Especially in the automotive field, fuel cell vehicles are regarded as one of the effective ways to solve the emission pollution problem of traditional fuel vehicles.

[0003] However, the complexity of the fuel cell system and the diversity of the operating environment make it inevitable to have various faults in actual applications. These faults may stem from multiple aspects such as system design, manufacturing, operating environment, and use and maintenance, such as water management faults in the stack (including membrane drying and flooding), sensor faults, actuator faults, and the decline in single-cell performance. These faults not only affect the performance and lifespan of the fuel cell system but also pose a threat to the safe operation of the vehicle.

[0004] Therefore, reliable and effective fault diagnosis technology is crucial for ensuring the safe and stable operation of the fuel cell system. Fault diagnosis technology can timely identify and locate faults, provide accurate fault information for maintenance personnel, thereby shortening the maintenance time, reducing the maintenance cost, and improving the availability and reliability of the system. At the same time, through fault diagnosis technology, the operating state of the fuel cell system can also be monitored and analyzed in real time, providing a scientific basis for the maintenance and management of the system and further extending the service life of the system. In the aspect of deep learning, using CNN or RNN, etc. can further improve the accuracy and real-time performance of prediction. This article mainly focuses on the latter, that is, the RUL prediction in the aspect of deep learning. Traditional CNN is limited by the receptive field of the convolutional kernel. Therefore, traditional convolution may be restricted to a certain extent when extracting features. In order to enable the convolutional network to have the ability to learn temporal information, the mainstream method is to use the parallel connection of convolution and LSTM, but this method will greatly increase the model complexity. The core idea of deformable convolution (DCN) is to add an offset learned through convolution on the basis of standard convolution. Thus, it can capture information that better conforms to the target shape. In previous studies, deformable convolution has been mostly used in image recognition. How to better apply DCN to RUL prediction and improve the prediction accuracy is the primary problem to be solved.

[0005] The degradation features extracted by the neural network also need to be fed into the fully connected layer to obtain the RUL prediction value for loss calculation and parameter update. However, the ordinary fully connected layer cannot effectively fuse the features extracted by the gradually upgraded hidden layers. Existing research has mostly focused on improving the hidden layers and made little change to the final fully connected layer. Based on the research results of Soviet mathematicians Vladimir Arnold and Andrey Kolmogorov, KAN decomposes complex high-dimensional data into learnable linear functions, effectively avoiding the curse of dimensionality and achieving high prediction accuracy, and having good interpretability and fitting ability. When KAN was initially proposed, the article fitted various formulas. Existing research has proven that KAN is superior to the traditional fully connected layer in feature fusion and extraction in some fields. Another key problem to be solved is how to combine KAN with the deformable convolutional residual attention mentioned above and effectively apply it to the fuel cell fault diagnosis method.

[0006] Due to the irregular changes in the input data of the battery, such as hydrogen pressure, air pressure, stack current, stack voltage, etc., the existing fuel cell fault diagnosis methods have the problem of low fault diagnosis accuracy. Summary of the Invention

[0007] The object of the present invention is to provide a fuel cell fault diagnosis method and system based on deformable convolutional residual attention for the problem of low fault diagnosis accuracy in the existing fuel cell fault diagnosis methods.

[0008] The technical solution adopted by the present invention to solve the above technical problems is:

[0009] A fuel cell fault diagnosis method based on deformable convolutional residual attention includes the following steps:

[0010] Obtain the operating parameters of the fuel cell to be diagnosed, input the operating parameters into the trained neural network to obtain the output battery life, and perform fault diagnosis on the fuel cell according to the output battery life;

[0011] The neural network is a deformable convolutional residual attention enhanced KAN model, and the deformable convolutional residual attention enhanced KAN model includes deformable convolution, residual attention mechanism and two KAN layers;

[0012] The deformable convolution is used to convert the input data into a four-dimensional tensor (N*C*H*W), that is, the original four-dimensional tensor. Then, obtain the height and width of the convolution kernel, both the height and width of the convolution kernel are k. Then, calculate the offset channel number of the introduced offset according to the height and width of the convolution kernel, and initialize all elements of the four-dimensional tensor to 0 using the offset channel number to obtain (N, 2*k 2, a tensor of all zeros with shape (N, C, H, W), and then activate the all-zero tensor and the original four-dimensional tensor by inputting them into the DCN to obtain an Out1 feature tensor with shape (N, 2*k 2 , H, W), where N is the number of batches of input data, C is the number of input channels, H is the height of the input data, i.e., the number of data at different measurement points, and W is the width of the input data, i.e., the number of data types measured at different measurement points;

[0013] The specific steps of the residual attention mechanism are as follows:

[0014] Step 1: Pass the original four-dimensional tensor through two convolutional layers in sequence to obtain the attention weight;

[0015] Step 2: Multiply the attention weight by the Out1 feature tensor to obtain the Out_att feature tensor;

[0016] Step 3: Add the Out_att feature tensor to the Out1 feature tensor to obtain the Out2 feature tensor;

[0017] Step 4: Input the Out2 feature tensor into the DCN to obtain the Out feature tensor;

[0018] Step 5: Add the Out feature tensor to the Out2 feature tensor to obtain the Out3 feature tensor;

[0019] Step 6: Pass the Out3 feature tensor through the max pooling layer and the dropout layer to obtain the first DCAR feature tensor;

[0020] Step 7: Use the first DCAR feature tensor as Out1 and repeat Steps 2 to 6 to obtain the second DCAR feature tensor;

[0021] Step 8: After the second DCAR feature tensor undergoes dimension observation, the encoding layer, and dimension correction in sequence, and then passes through two KANs in sequence to obtain a two-dimensional tensor.

[0022] Furthermore, the loss function of the deformable convolutional residual attention enhanced KAN model is expressed as:

[0023] ESLF = ω1·QTSE + ω2·DTW

[0024]

[0025] where a is the adjustment factor, ω1 and ω2 are weights, Dist(a i , b j ) is the Euclidean distance between two points, QTSE is the asymmetric smooth differentiable loss function, DTW is the DTW loss function, y t and They are the true value and predicted value at time t respectively. DTW(A, B) is the DTW distance between time series A and B, and a i , b j are the i-th and j-th points in A and B, where i ∈ (1, 2,......, m) and j ∈ (1, 2,......, n). Dist(a i , b j ) is the Euclidean distance between two points. m and n are the total numbers of points in the horizontal and vertical directions respectively, T is time, and dtw(·) is the DTW distance between two points.

[0026] Further, the specific method for performing fault diagnosis on the fuel cell according to the output battery life is as follows:

[0027]

[0028] Further, the operating parameters include hydrogen pressure, air pressure, active area of the stack, stack current, and stack voltage.

[0029] Further, the input data in the deformable convolution is the data processed by the Savitzky-Golay filter.

[0030] A fuel cell fault diagnosis system based on deformable convolution residual attention, and the system specifically executes the following steps:

[0031] Obtain the operating parameters of the fuel cell to be diagnosed, input the operating parameters into the trained neural network to obtain the output battery life, and perform fault diagnosis on the fuel cell according to the output battery life;

[0032] The neural network is a deformable convolution residual attention enhanced KAN model, and the deformable convolution residual attention enhanced KAN model includes a deformable convolution, a residual attention mechanism, and two KAN layers;

[0033] The deformable convolution is used to convert the input data into a four-dimensional tensor (N*C*H*W), which is the original four-dimensional tensor. Then, obtain the height and width of the convolution kernel. The height and width of the convolution kernel are both k. Then, calculate the offset channel number of the introduced offset according to the height and width of the convolution kernel, and initialize all elements of the four-dimensional tensor to 0 using the offset channel number to obtain a all-zero tensor of (N, 2*k 2 , H, W), and then input the all-zero tensor and the original four-dimensional tensor into the DCN for activation to obtain the Out1 feature tensor of (N, 2*k 2 , H, W). Among them, N is the batch number of the input data, C is the input channel number, H is the height of the input data, that is, the number of data at different measurement points, and W is the width of the input data, that is, the number of data types measured at different measurement points;

[0034] The specific implementation steps of the residual attention mechanism are as follows:

[0035] Step 1: Pass the original four-dimensional tensor through two convolutional layers in sequence to obtain the attention weights;

[0036] Step 2: Multiply the attention weights by the Out1 feature tensor to obtain the Out att feature tensor;

[0037] Step 3: Add the Out att feature tensor and the Out1 feature tensor to obtain the Out2 feature tensor;

[0038] Step 4: Input the Out2 feature tensor into the DCN to obtain the Out feature tensor;

[0039] Step 5: Add the Out feature tensor and the Out2 feature tensor to obtain the Out3 feature tensor;

[0040] Step 6: Pass the Out3 feature tensor through the max pooling layer and the dropout layer to obtain the first DCAR feature tensor;

[0041] Step 7: Use the first DCAR feature tensor as Out1, and repeat Steps 2 to 6 to obtain the second DCAR feature tensor;

[0042] Step 8: After the second DCAR feature tensor undergoes dimension observation, encoding layer, and dimension correction in sequence, and then passes through two KANs in sequence to obtain a two-dimensional tensor.

[0043] Furthermore, the loss function of the deformable convolutional residual attention enhanced KAN model is expressed as:

[0044] ESLF = ω1·QTSE + ω2·DTW

[0045]

[0046]

[0047] Among them, a is an adjustment factor, ω1 and ω2 are weights, Dist(a i , b j ) is the Euclidean distance between two points, QTSE is an asymmetric smooth differentiable loss function, DTW is the DTW loss function, y t and are the true value and the predicted value at time t respectively, DTW(A, B) is the DTW distance between time series A and B, a i , b j are the i-th and j-th points in A and B, i ∈ (1, 2,......, m), j ∈ (1, 2,......, n), Dist(ai , b j ), which is the Euclidean distance between two points, m and n are the total numbers of points in the horizontal and vertical directions respectively, T is the time, and dtw(·) is the DTW distance between two points.

[0048] Furthermore, the specific method for fault diagnosis of the fuel cell according to the output battery life is as follows:

[0049]

[0050] Furthermore, the operating parameters include hydrogen pressure, air pressure, active area of the fuel cell stack, stack current, and stack voltage.

[0051] Furthermore, the input data in the deformable convolution is the data processed by the Savitzky-Golay filter.

[0052] The beneficial effects of the present invention are:

[0053] In this application, by using the combination of the QTSE loss function that gives a greater penalty to lag prediction and the DTW loss function that enhances correlation, and combining the deformable convolution residual attention mechanism and the KAN network to process the input data, the correlation between data is enhanced, and the problem of low fault diagnosis accuracy in the existing fuel cell fault diagnosis method caused by the irregular changes in the input data of the battery is reduced. The technical solution of this application effectively improves the accuracy and reliability of fuel cell fault detection. Description of the Drawings

[0054] Figure 1 It is a schematic diagram of the DCN structure;

[0055] Figure 2 It is a schematic diagram of the deformable convolution residual attention structure;

[0056] Figure 3 It is a schematic diagram of the training process of KAN;

[0057] Figure 4 It is a schematic diagram of the training process of deep KAN;

[0058] Figure 5 It is a schematic diagram of the loss function for simple advanced prediction;

[0059] Figure 6 It is an example diagram of four different predictions;

[0060] Figure 7 It is a feature map of the asymmetric loss function;

[0061] Figure 8 It is a visualization schematic diagram of the DTW fitting process;

[0062] Figure 9 This is the overall network structure diagram of the present application;

[0063] Figure 10 This is the schematic diagram of the 200KW fuel cell power generation system;

[0064] Figure 11 This is the imported hydrogen pressure diagram;

[0065] Figure 12 This is the exported hydrogen pressure diagram;

[0066] Figure 13 This is the imported air pressure diagram;

[0067] Figure 14 This is the exported air pressure diagram;

[0068] Figure 15 This is the air mass flow diagram;

[0069] Figure 16 This is the main heat dissipation power diagram;

[0070] Figure 17 This is the auxiliary heat dissipation power diagram;

[0071] Figure 18 This is the coolant inlet temperature diagram;

[0072] Figure 19 This is the coolant outlet temperature diagram;

[0073] Figure 20 This is the active area diagram of the fuel cell stack;

[0074] Figure 21 This is the current diagram of the fuel cell stack;

[0075] Figure 22 This is the voltage diagram of the fuel cell stack;

[0076] Figure 23 This is the average single-cell voltage diagram of the fuel cell stack;

[0077] Figure 24 This is the single-cell quantity diagram;

[0078] Figure 25 This is the output power diagram of the fuel cell stack;

[0079] Figure 26 This is the temperature diagram of the fuel cell stack;

[0080] Figure 27 This is the power generation diagram. Specific embodiments

[0081] It should be specifically noted that, without conflict, the various embodiments disclosed in the present application can be combined with each other.

[0082] Embodiment 1: A fuel cell fault diagnosis method based on deformable convolutional residual attention is characterized by including the following steps:

[0083] Obtain the operating parameters of the fuel cell to be diagnosed, input the operating parameters into the trained neural network to obtain the output battery life, and perform fault diagnosis on the fuel cell according to the output battery life;

[0084] The neural network is a deformable convolutional residual attention enhanced KAN model, and the deformable convolutional residual attention enhanced KAN model includes deformable convolution, residual attention mechanism and two layers of KAN layers;

[0085] The deformable convolution is used to convert the input data into a four-dimensional tensor (N*C*H*W), which is the original four-dimensional tensor. Then, obtain the height and width of the convolution kernel, both of which are k. Then, calculate the offset channels of the introduced offset according to the height and width of the convolution kernel, and initialize all elements of the four-dimensional tensor to 0 using the offset channels to obtain a all-zero tensor of (N, 2*k 2 , H, W), and then input the all-zero tensor and the original four-dimensional tensor into DCN for activation to obtain an Out1 feature tensor of (N, 2*k 2 , H, W), where N is the number of batches of input data, C is the number of input channels, H is the height of the input data, i.e., the number of data at different measurement points, and W is the width of the input data, i.e., the number of data types measured at different measurement points;

[0086] The specific steps of the residual attention mechanism are as follows:

[0087] Step 1: Pass the original four-dimensional tensor through two layers of convolution in sequence to obtain the attention weight;

[0088] Step 2: Multiply the attention weight by the Out1 feature tensor to obtain the Out att feature tensor;

[0089] Step 3: Add the Out att feature tensor and the Out1 feature tensor to obtain the Out2 feature tensor;

[0090] Step 4: Input the Out2 feature tensor into DCN to obtain the Out feature tensor;

[0091] Step 5: Add the Out feature tensor and the Out2 feature tensor to obtain the Out3 feature tensor;

[0092] Step 6: Pass the Out3 feature tensor through the max pooling layer and the dropout layer to obtain the first DCAR feature tensor;

[0093] Step 7: Take the first DCAR feature tensor as Out1, and repeat Steps 2 to 6 to obtain the second DCAR feature tensor;

[0094] Step 8: After the second DCAR feature tensor passes through dimension observation, an encoding layer, and dimension correction in sequence, it then passes through two layers of KAN in sequence to obtain a two-dimensional tensor.

[0095] Deformable convolution:

[0096] In traditional convolution, the position of each part on the feature map is fixed, while in deformable convolution, an offset is introduced to adapt to the shape of the data, as shown below.

[0097]

[0098]

[0099] Among them, ω(x) is the weight at the corresponding position of the convolution kernel; is the value at the position of p0 + p n ; the introduced Δp n is the offset in DCN. A simple structure is as Figure 1 shown:

[0100] Integrate the input data of N batches into a four-dimensional tensor, and preprocess the data using the Savitzky-Golay filter. Obtain the Figure 1 input tensor in. At this time, the dimension of the input tensor is (N * C * H * W). Among them, N is the number of batches of input data, C is the number of input channels, H is the height of the input data, that is, the number of data at different measurement points, and W is the width of the input data, that is, the number of data types measured at different measurement points. First, obtain the offset at this time. Let's assume that the convolution kernel is square. At this time, the height and width of the convolution kernel are equal and set to k. Calculate the number of offset channels:

[0101] offset channels = 2 * k 2 (3)

[0102] Initialize all elements of the tensor to 0 to obtain a all-zero tensor of (N, 2 * k 2 , H, W). Then input this all-zero tensor and the original input into DCN for activation together to obtain a tensor of (N, 2 * k 2 , H, W).

[0103] Deformable convolution residual attention mechanism:

[0104] Based on the above deformable convolution, construct a deformable convolution residual attention mechanism network. As Figure 2 shown:

[0105] The input tensor is separately fed into the deformable convolution and the attention mechanism described above. The two-layer convolution in the attention mechanism causes the second dimension of the tensor to first decrease and then increase. The attention weights are obtained and multiplied and added to the tensor that has passed through the DCN to obtain the output tensor.

[0106]

[0107] The output Out2 is passed through the DCN shown in (d) and then added. The result is then passed through the convolution shown in (a) to obtain the final output.

[0108]

[0109] The above process constructs the overall deformable convolution residual attention network. This application will use two layers of the above deformable convolution residual attention.

[0110] KAN: Kolmogorov–Arnold Network

[0111] Kolmogorov–Arnold Network is a revolutionary neural network method proposed in 2024. It is essentially different from the commonly used multi-layer perceptron (MLP). Its theoretical basis comes from the research results of Soviet mathematicians Vladimir Arnold and Andrey Kolmogorov. Any multivariable continuous function is a combination of a finite number of single-variable continuous functions:

[0112]

[0113] Φ in the formula q , Φ q,p are continuous single-variable functions.

[0114] The above theorem provides a theoretical basis for constructing the KAN model. In machine learning, an increase in data dimension usually leads to the curse of dimensionality in the MLP. And the above theorem can decompose a high-dimensional function into simple functions. This provides a theoretical basis for overcoming this disaster. Different from common neural networks, KAN abandons the fixed commonly used activation functions. Instead, it uses learnable activation functions. The weights of each function are changing during learning, that is, the weights are replaced by a function with a single variable. At the same time, compared with the non-linear transformation of the traditional output, KAN directly retains the original output. As shown below:

[0115]

[0116] According to existing research, the Gauss-Newton (GN) Method and the Newton-Kaczmarz (NK) Method are applied in KAN as methods for optimizing network parameters. And B-spline interpolation, as the core of KAN, functions as follows:

[0117] First, a basis function b(x) for the residual link is defined:

[0118]

[0119] Let the activation function be the sum of the basis function b(x) and the B-spline interpolation after a certain weight processing:

[0120] Φ(x) = ω b *b(x) + ω s *spline(x) (10)

[0121] where

[0122]

[0123] The workflow of KAN training is as Figure 3 shown. In spline(x), the C i parameter is gradually optimized. First, a part of the single-valued function is faded out. As the training progresses, while the faded single-valued function disappears, other single-valued functions are also gradually changing their shapes to adapt to the training data. At the third step in the following figure, the remaining single-valued functions on the left and right are added together. Finally, the result of this training process is obtained.

[0124] According to formula (6), a deep KAN model as Figure 4 shown is established. Its training process is similar to the above process. It has experienced the fading, pruning, and adding processes of single-valued functions.

[0125] 1) The combined loss function with asymmetric characteristics and shape constraints

[0126] Fuel cell fault diagnosis for intelligent maintenance needs to meet the requirements of advance and relevance. The possible prediction situations are as follows. First, assume a simple loss function with different penalty mechanisms:

[0127] According to Figure 5 and Figure 6 the simple advance prediction loss function and the fuel cell fault diagnosis results specified:

[0128]

[0129] When comparing (a) and (b) with the same correlation, the Score value of the leading prediction is smaller than that of the lagging prediction. This indicates that the loss function should satisfy the property of imposing a greater penalty on the lagging prediction. When comparing (c) and (d), with the same Score, even though all four values are lagging predictions at this time, the trend is basically consistent with the true value. A higher correlation can more accurately simulate the degradation trend at this time

[0130] Therefore, on the premise of ensuring accuracy, although leading prediction will cause early maintenance and economic losses, it will not cause catastrophic downtime like lagging maintenance. On the other hand, the prediction result needs to have a high correlation with the true result, which can ensure the monotonic decrease of the prediction result and improve the usability

[0131] 2) QTSE

[0132] One of the evaluation indicators for fuel cell fault diagnosis, the Score function, is used for advance evaluation, and its formula is as follows:

[0133]

[0134] In the formula, y t and are the true value and the predicted value at time t respectively. This function is not differentiable at and is not suitable for directly serving as a loss function. In the literature, an asymmetric smooth differentiable loss function was proposed. Its defining equation is:

[0135]

[0136] where a is an adjustment factor, which is set to 0.1 in this paper. To more vividly understand the advantage of this function for leading prediction. It may be changed to the following function and plotted.

[0137] Q(Δy) = Δy 2 exp(aΔy) (16)

[0138] where That is, the difference between the predicted value and the actual value is used as the abscissa. We get Figure 7 :

[0139] When the difference between the predicted value and the actual value is less than 0, a certain value is obtained. When the difference between the predicted value and the actual value is greater than 0, the obtained value will show exponential growth. That is, the lagging prediction will be severely punished, and the lagging error will be more severely punished than the leading error. Therefore, the addition of QTSE can numerically impose a certain constraint on the final prediction result

[0140] 3) DTW

[0141] The basic idea of DTW is to find the optimal alignment path between two time series through dynamic programming. Let's first define two time series:

[0142]

[0143] Among them, a i (i ∈ (1, 2,......, m)), b j (j ∈ (1, 2,......, n)) are the i-th and j-th points in A and B. The DTW distance between two time series A and B is expressed as follows:

[0144]

[0145] Among them, Dist(a i , b j ) is the Euclidean distance between two points. m and n respectively refer to the total number of points in the horizontal and vertical directions; T is time; dtw(·) is the DTW distance between two points.

[0146] The DTW algorithm will construct a matrix. The matrix elements are the distances between the above two time series A and B at different time points. According to Equation (18), DTW starts from the lower left corner of the matrix and gradually moves to the upper right corner. During the movement, it will simultaneously find a path with the smallest sum of elements. Then this path is the optimal alignment path between the two time series.

[0147] Taking a certain fluctuation function as an example, a certain amount of random noise is introduced to visualize the DTW working process. It can be seen from the above theory and visualization results that the DTW loss function can largely ensure that the overall function shapes between the true value and the predicted value are highly similar. The process is as Figure 8 shown.

[0148] QTSE has the ability to ensure the advance of the prediction result; DTW has the ability to ensure shape similarity, that is, to ensure that the prediction result and the true sequence have the same monotonically decreasing characteristic. In this part, the two are combined with a certain weight to obtain a loss function ESLF that satisfies both numerical and shape similarity. And it is applied to the remaining useful life prediction for the first time.

[0149] ESLF = ω1·QTSE + ω2·DTW (19)

[0150] 4) The main network architecture of this application

[0151] This application combines the DCN model, which performs outstandingly in image recognition, with the KAN model in formula fitting. It is used for fuel cell fault diagnosis. Select the first test machine with 9 input channels. As Figure 9 is the main structure of the model:

[0152] (a) shown in the figure is the deformable convolutional residual attention structure described in 1). After the data goes through two steps of deformable convolutional residual attention and maxpool, dropout, a position encoder for generating a fixed dimension is introduced. This is used to enhance the model's understanding of the sequence and improve performance. The data is processed into a two-dimensional tensor so that it can enter the KAN model. Finally, the data goes through two layers of the KAN model described in 3). The data changes from the input (N, C, H, W) to an (N, 1) tensor.

[0153] 5) A fuel cell fault diagnosis method based on deformable convolutional residual attention has an enhanced Kolmogorov - Arnold network with prediction advance and shape constraint, and its implementation process is as Figure 10 shown;

[0154] Step 1: Data loading and preprocessing

[0155] According to the above - mentioned schematic diagram of the 200KW fuel cell power generation system, a data acquisition system is constructed. This system includes multiple sensors for real - time monitoring of key operating parameters of the fuel cell, such as hydrogen pressure, air pressure, active area of the fuel cell stack, stack current, stack voltage, etc. According to a predetermined time interval and sampling frequency, the operating data of the fuel cell is obtained from the sensors. The data acquisition process should ensure the real - time and accuracy of the data. The Savitzky - Golay filter is used to preprocess the collected raw data to improve the signal - to - noise ratio, improve the data quality, and store it in the database, providing a reliable data basis for subsequent data analysis and fault diagnosis.

[0156] According to a predetermined time interval and sampling frequency, the operating data of the fuel cell is obtained from the sensors, and the parameters include hydrogen pressure, air pressure, active area of the fuel cell stack, stack current, stack voltage;

[0157] After preprocessing the collected raw data using the Savitzky - Golay filter, it is stored in the database.

[0158] Step 2: Deep learning

[0159] According to the model introduced above, the processed data is input into the overall structure as Figure 9 shown. The deformable convolutional residual attention mechanism is used to extract key features, the extracted features are fused through the KAN model to obtain more accurate degradation features, and a combined loss function is used for training to obtain a fault diagnosis model.

[0160] 6) Fault type description

[0161] According to the IEEE standard, the remaining useful life (RUL) corresponding to the core fault characteristics and the fault severity at this time is as shown in the following table:

[0162]

[0163]

[0164] This application proposes a deformable convolutional residual attention framework. In response to the above analysis, this paper proposes a method that combines deformable convolution with an attention mechanism to improve the reliability of prediction results.

[0165] KAN is introduced into the field of fuel cell fault diagnosis. Using KAN, the further fusion of engine degradation characteristics and fuel cell fault diagnosis is realized, which has significant advantages compared with traditional fully connected networks. A two-layer KAN structure is constructed and combined with deformable convolutional residual attention to train the model.

[0166] This application proposes a combined loss function (ESLF) with asymmetric characteristics and shape constraints. In this paper, QTSE and DTW are combined in a certain proportion to achieve early prediction and shape constraints.

[0167] Observe the laboratory operation data of a 200KW fuel cell system. Take the data from 10:00 to 13:50 on May 10, 2024 as an example. Now, the data of each measurement point is visualized. The results are as Figures 11 to 27 shown.

[0168] It should be noted that the specific implementation manners are only explanations and illustrations of the technical solutions of the present invention, and the scope of the right protection cannot be limited thereby. All those that are only partial changes made according to the claims and the description of the present invention should still fall within the protection scope of the present invention.

Claims

1. A fuel cell fault diagnosis method based on deformable convolutional residual attention, characterized in that It includes the following steps: Obtain the operating parameters of the fuel cell to be diagnosed, input the operating parameters into the trained neural network to obtain the output battery life, and perform fault diagnosis on the fuel cell according to the output battery life; The neural network is a deformable convolutional residual attention enhanced KAN model, and the deformable convolutional residual attention enhanced KAN model includes a deformable convolution, a residual attention mechanism, and two KAN layers; The deformable convolution is used to convert the input data into a four-dimensional tensor (N*C*H*W), which is the original four-dimensional tensor. Then, the height and width of the convolution kernel are obtained. The height and width of the convolution kernel are both k. Then, the number of offset channels of the introduced offset is calculated according to the height and width of the convolution kernel, and all elements of the four-dimensional tensor are initialized to 0 using the number of offset channels, resulting in a zero tensor of (N, 2*k 2 , H, W). Then, the zero tensor and the original four-dimensional tensor are input into the DCN for activation, resulting in an Out1 feature tensor of (N, 2*k 2 , H, W). Here, N is the number of batches of the input data, C is the number of input channels, H is the height of the input data, i.e., the number of data at different measurement points, and W is the width of the input data, i.e., the number of data types measured at different measurement points; The specific steps of the residual attention mechanism are as follows: Step 1: Pass the original four-dimensional tensor through two convolutional layers in sequence to obtain the attention weight; Step 2: Multiply the attention weight by the Out1 feature tensor to obtain the Out att feature tensor; Step 3: Add the Out att feature tensor and the Out1 feature tensor to obtain the Out2 feature tensor; Step 4: Input the Out2 feature tensor into the DCN to obtain the Out feature tensor; Step 5: Add the Out feature tensor and the Out2 feature tensor to obtain the Out3 feature tensor; Step 6: Pass the Out3 feature tensor through a max pooling layer and a dropout layer to obtain the first DCAR feature tensor; Step 7: Use the first DCAR feature tensor as Out1, and repeat Steps 2 to 6 to obtain the second DCAR feature tensor; Step 8: After the second DCAR feature tensor goes through dimension observation, an encoding layer, and dimension correction in sequence, it goes through two KANs in sequence to obtain a two-dimensional tensor.

2. The fuel cell fault diagnosis method based on deformable convolutional residual attention according to claim 1, wherein The loss function of the deformable convolutional residual attention enhanced KAN model is expressed as: ESLF = ω1·QTSE + ω2·DTW where a is an adjustment factor, ω1 and ω2 are weights, Dist(a i , b j ) is the Euclidean distance between two points, QTSE is an asymmetric smooth differentiable loss function, DTW is the DTW loss function, y t and are the true value and the predicted value at time t respectively, DTW(A, B) is the DTW distance between time series A and B, a i , b j are the i-th and j-th points in A and B, i ∈ (1, 2,......, m), j ∈ (1, 2,......, n), Dist(a i , b j ) is the Euclidean distance between two points, m and n are the total numbers of points in the horizontal and vertical directions respectively, T is time, and dtw(·) is the DTW distance between two points.

3. A fuel cell fault diagnosis method based on deformable convolutional residual attention according to claim 1, characterized in that The specific method of performing fault diagnosis on the fuel cell according to the output battery life is as follows:

4. A fuel cell fault diagnosis method based on deformable convolutional residual attention according to claim 1, characterized in that The operating parameters include hydrogen pressure, air pressure, active area of the stack, stack current, and stack voltage.

5. A fuel cell fault diagnosis method based on deformable convolutional residual attention according to claim 1, characterized in that The data input into the deformable convolution is the data processed by the Savitzky-Golay filter.

6. A fuel cell fault diagnosis system based on deformable convolutional residual attention, characterized in that The system specifically executes the following steps: Obtain the operating parameters of the fuel cell to be diagnosed, input the operating parameters into the trained neural network to obtain the output battery life, and perform fault diagnosis on the fuel cell according to the output battery life; The neural network is a deformable convolutional residual attention enhanced KAN model, and the deformable convolutional residual attention enhanced KAN model includes a deformable convolution, a residual attention mechanism, and two KAN layers; The deformable convolution is used to convert the input data into a four-dimensional tensor (N*C*H*W), which is the original four-dimensional tensor. Then, the height and width of the convolution kernel are obtained. The height and width of the convolution kernel are both k. Then, the number of offset channels of the introduced offset is calculated according to the height and width of the convolution kernel, and all elements of the four-dimensional tensor are initialized to 0 using the number of offset channels, resulting in a zero tensor of (N, 2*k 2 , H, W). Then, the zero tensor and the original four-dimensional tensor are input into the DCN for activation, obtaining an Out1 feature tensor of (N, 2*k 2 , H, W). Among them, N is the number of batches of the input data, C is the number of input channels, H is the height of the input data, i.e., the number of data at different measurement points, and W is the width of the input data, i.e., the number of data types measured at different measurement points; The specific steps of the residual attention mechanism are as follows: Step 1: Pass the original four-dimensional tensor through two convolutional layers in sequence to obtain the attention weight; Step 2: Multiply the attention weight by the Out1 feature tensor to obtain the Out att feature tensor; Step 3: Add the Out att feature tensor and the Out1 feature tensor to obtain the Out2 feature tensor; Step 4: Input the Out2 feature tensor into the DCN to obtain the Out feature tensor; Step 5: Add the Out feature tensor and the Out2 feature tensor to obtain the Out3 feature tensor; Step 6: Pass the Out3 feature tensor through a max pooling layer and a dropout layer to obtain the first DCAR feature tensor; Step 7: Take the first DCAR feature tensor as Out1, and repeat Steps 2 to 6 to obtain the second DCAR feature tensor; Step 8: After the second DCAR feature tensor goes through dimension observation, an encoding layer, and dimension correction in sequence, and then goes through two layers of KAN in sequence to obtain a two-dimensional tensor.

7. The fuel cell fault diagnosis system based on deformable convolutional residual attention according to claim 6, wherein The loss function of the deformable convolutional residual attention enhanced KAN model is expressed as: ESLF = ω1·QTSE + ω2·DTW Among them, a is an adjustment factor, ω1 and ω2 are weights, Dist(a i ,b j ) is the Euclidean distance between two points, QTSE is an asymmetric smooth differentiable loss function, DTW is the DTW loss function, y t and are the true value and the predicted value at time t respectively, DTW(A,B) is the DTW distance between time series A and B, a i ,b j are the i-th and j-th points in A and B, i ∈ (1,2,......,m), j ∈ (1,2,......,n), Dist(a i ,b j ) is the Euclidean distance between two points, m and n are the total numbers of points in the horizontal and vertical directions respectively, T is time, and dtw(·) is the DTW distance between two points.

8. A fuel cell fault diagnosis system based on deformable convolutional residual attention according to claim 6, characterized in that The specific method for performing fault diagnosis on the fuel cell according to the output battery life is as follows:

9. A fuel cell fault diagnosis system based on deformable convolutional residual attention according to claim 6, characterized in that The operating parameters include hydrogen pressure, air pressure, active area of the fuel cell stack, current of the fuel cell stack, and voltage of the fuel cell stack.

10. A fuel cell fault diagnosis system based on deformable convolutional residual attention according to claim 6, characterized in that The data input in the deformable convolution is the data processed by the Savitzky-Golay filter.