Fuel cell performance degradation prediction method and system based on deep learning
By combining simulated annealed isolated forest algorithm, Gaussian filtering algorithm, SHAP-TCN feature selection, and DeformableTST deep learning model and quantile regression method, the fuel cell performance degradation prediction interval is constructed, which solves the nonlinearity and uncertainty problems in fuel cell life prediction, and achieves higher precision prediction.
Patent Information
- Application Number
- CN202510338488.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-08-01
AI Technical Summary
The existing fuel cell life prediction methods are difficult to effectively deal with the nonlinear performance degradation and uncertainty of fuel cells, resulting in low prediction accuracy and large noise interference.
The performance degradation prediction interval is constructed through data preprocessing, feature screening and model optimization through data preprocessing, feature screening and model optimization.
It improves the accuracy of fuel cell remaining life prediction, effectively solves the uncertainty problem in traditional methods, and provides more reliable technical support for the predictive maintenance and management of fuel cells.
Smart Images

Figure CN120405477A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of proton exchange membrane fuel cell (PEMFC) performance prediction, and in particular, a method and system for predicting the remaining life of a fuel cell based on deep learning, which is applied to the predictive maintenance and management of fuel cells. Background Art
[0002] Fuel cells face the problem of performance degradation in practical applications. In particular, during long-term operation, the efficiency and output power of the battery gradually decrease, seriously affecting its service life and economic efficiency. The degradation data of proton exchange membrane fuel cells (PEMFC) has nonlinear characteristics and random characteristics of voltage drop and voltage recovery, which makes data processing and analysis difficult. Existing fuel cell life prediction methods usually rely on traditional physical modeling or statistical methods. Although these methods can provide certain prediction results, they often have difficulty in effectively handling complex degradation processes and nonlinear characteristics, and their ability to handle uncertainty problems is weak. Therefore, existing methods have problems such as low prediction accuracy, large noise interference, and difficulty in handling uncertainty. Summary of the Invention
[0003] Purpose of the Invention: To address the aforementioned issues, this paper proposes a deep learning-based method for predicting fuel cell performance degradation. This method combines data preprocessing using a simulated annealing isolation forest algorithm and a Gaussian filter algorithm, SHAP-TCN feature selection, a DeformableTST deep learning model, and quantile regression. The method aims to improve prediction accuracy and address the uncertainty inherent in traditional methods. This integration of techniques enables more accurate predictions of the remaining life of fuel cells, providing more effective technical support for predictive maintenance and management of fuel cells.
[0004] Technical solution: A deep learning-based method for predicting fuel cell performance degradation, including:
[0005] Step 1: Collect historical fuel cell operation data and pre-process the data using the simulated annealing isolation forest algorithm to remove abnormal data;
[0006] Step 2: Use Gaussian filtering algorithm to remove noise from the fuel cell data after removing abnormal data;
[0007] Step 3: Use the SHAP-TCN method to perform feature screening on the preprocessed data and extract the features that are most influential in predicting performance degradation;
[0008] Step 4: Adopt the adaptive regularization weighted method to optimize the partial reinforcement optimizer algorithm PRO (Partial Reinforcement Optimizer, PRO) to obtain the improved partial reinforcement optimizer algorithm IPRO;
[0009] Step 5: Using the filtered features as input, the DeformableTST deep learning model is combined with quantile regression (QR) to construct a performance degradation prediction interval to fully capture the uncertainty in the prediction process.
[0010] Step 6: Use the improved partial reinforcement optimizer algorithm IPRO to tune the hyperparameters of the performance degradation prediction model. The optimization objectives include minimizing the prediction error, maximizing the probability of interval coverage (PICP), and minimizing the prediction interval width (PINAW).
[0011] Step 7: Based on the optimization results, a fuel cell performance degradation prediction interval model based on IPRO-DeformableTST-QR is constructed. The filtered features are input into the model to output the fuel cell performance degradation prediction interval, i.e., the fuel cell output stack voltage interval, thereby providing technical support for predictive maintenance and management of fuel cells.
[0012] Furthermore, the simulated annealing isolation forest algorithm combines simulated annealing and isolation forest algorithms, and uses the simulated annealing algorithm to optimize hyperparameters in the isolation forest, wherein the hyperparameters include the number of trees k, the maximum depth of the tree d, and the subsample size.
[0013] Initial hyperparameters: θ0 = {k0, d0, subsample size0}, defining the objective function Used to evaluate the performance of the isolation forest model on the validation set; assuming that the model obtained by training the isolation forest using the hyperparameter θ is T(θ), the objective function is: Among them, Error is the error calculated by the evaluation index (mean square error);
[0014] In each iteration, simulated annealing generates new candidate hyperparameters by perturbing the current hyperparameters θ:
[0015] Finally, simulated annealing iteratively optimizes the hyperparameters of the isolation forest so that the objective function Reaching the minimum value, that is, the optimized hyperparameters can achieve the best anomaly detection effect; the optimal hyperparameters: θ * 、Final model: T(θ * ).
[0016] Furthermore, the step 2 of removing noise from the fuel cell data by using a Gaussian filter algorithm to remove abnormal data includes:
[0017] Gaussian filtering performs a weighted average of the filter and the input data. Assuming that I(t) is the time series of the fuel cell output voltage data, the convolution operation is expressed as:
[0018]
[0019] where: I(t) is the original fuel cell data at time t; I out (t) is the output data after Gaussian filtering; H′(i) is the normalized Gaussian filter; t + i represents taking the signal within the window from the original data for weighted averaging, k is the half-width of the filter, and i = -k, -k + 1, …, k.
[0020] Further, in step 3, the SHAP-TCN method is used to perform feature screening on the preprocessed data:
[0021] SHAP values are used to explain the contribution of each feature in the TCN model to the prediction result. Assuming that the output of the trained TCN model f for an input sample x is f(x), the SHAP value can be expressed as:
[0022]
[0023] where: x S represents the feature subset after removing feature x j , x j is feature j, is all possible feature subsets, indicates that set S is sampled from all possible feature subsets ; the SHAP value measures the contribution of feature j to the model output; for time series data, the SHAP value usually needs to be calculated at multiple time steps, so the SHAP value of the feature at each time step needs to be calculated and summed to obtain the global feature importance;
[0024] Calculate the SHAP values of all features, and rank the importance of each feature in the fuel cell data; set a threshold ∈, and select the features with SHAP values greater than the threshold as important features. Assuming that for each feature x j of the fuel cell, its SHAP value is φ j (f, x), perform feature selection according to the following steps:
[0025]
[0026] where, is the selected feature set.
[0027] Further, in step 4, the adaptive regularization weighting method is used to optimize the partial reinforcement optimizer algorithm PRO to obtain the improved partial reinforcement optimizer algorithm IPRO, and the process is as follows:
[0028] Initialize the population X = {X1, X2, …, X P}, where the population size is P, and each individual X i is a solution containing N behavioral variables (decision variables):
[0029] X i ={X i,1 , X i,2 , …, X i,N}, i = 1, 2, …, P
[0030] Initialize the scheduling table Schedule = {Schedule1, Schedule2, …, Schedule N}, representing the priority of each behavioral variable; set the regularization parameter λ and the learning rate η0; the time factor τ is used to measure the progress of the current iteration process; the selection rate SR is used to control the probability of selecting behavioral variables;
[0031] For each behavioral variable, introduce an adaptive weight ω j to measure the relative importance of different behavioral variables:
[0032]
[0033] where, Std(X j ): represents the standard deviation of behavioral variable j, used to characterize its variation range in the population, and the normalization term limits the weight range to [0, 1];
[0034] According to the scheduling table and the selection rate, select a set of behavioral variables μ:
[0035] μ = {j | Schedule j ≥ Schedule ★},
[0036] where, Schedule j : the scheduling priority of behavioral variable j, Schedule * : the threshold in the scheduling table;
[0037] After adding the adaptive weight ω j , the stimulation factor SF i is updated as:
[0038]
[0039] U(0, β) represents a uniform distribution on the interval [0, β];
[0040] The behavioral variables are updated according to the following formula:
[0041]
[0042] Direction factor
[0043]
[0044] wherein, is the current optimal solution, η and α are learning rates;
[0045] η = η0·e -τ The initial learning rate η0 is relatively large and gradually decreases as the iteration process progresses;
[0046] Regularization term:
[0047]
[0048] wherein, λ is the regularization coefficient and is dynamically adjusted as:
[0049]
[0050] X all is the set of behavioral variables of all individuals;
[0051] After the behavioral variables are updated, the scheduling table is updated based on the reinforcement learning mechanism:
[0052] If the new solution is better, positive reinforcement:
[0053] If the new solution is not better, negative reinforcement:
[0054] Positive reinforcement increases the priority, negative reinforcement decreases the priority, and the weight ω j determines the amplitude of the update of the scheduling table; reinforcement rate RR;
[0055] If the standard deviation of the scheduling table is lower than the threshold, reset the scheduling table:
[0056]
[0057] If the standard deviation of the behavioral variables is lower than the threshold, reset the behavioral variables:
[0058]
[0059] L B ,U B are the lower and upper bounds when resetting the behavioral variable X i The current function evaluation times is FEs, and the maximum function evaluation times is MaxFEs. When FEs ≥ MaxFEs or other set termination conditions are met, output the current optimal solution X best .
[0060] Further, in step 5, the filtered features are used as input, and combined with the DeformableTST deep learning model and the quantile regression method, the specific process of constructing the performance degradation prediction interval is as follows:
[0061] Step 5.1: Input the fuel cell time series into the DeformableTST deep learning model: where B is the batch size, I is the input sequence length, and M is the number of features;
[0062] Output the prediction sequence: where is the output sequence length;
[0063] Step 5.2: Use the Reverse Instance Normalization (RevIN) method to standardize the input sequence:
[0064] X in = RevIN(X in , mode = norm)
[0065] mode = norm represents standardization;
[0066] Transpose the input tensor to adapt to the model calculation dimension:
[0067]
[0068] Reshape the input data:
[0069] X in = reshape(X in )
[0070] Step 5.3: Embed the input sequence into a deformable encoded feature representation: X0 = Embedding(X in ) where, D i The feature embedding dimension in the i-th block, N i The time series feature length in the i-th block; Embedding represents embedding;
[0071] Step 5.4: Iterate the DeformableTST block to extract local temporal information, use deformable attention to extract global temporal information, and learn local information and new feature representations through a feed-forward network with depthwise convolution;
[0072] Step 5.5: In the last layer, reshape the embedding representation into the target shape:
[0073] X L = reshape(X L )
[0074] Predict the target sequence through the fully connected layer:
[0075]
[0076] in, L is the number of DeformableTST blocks,
[0077] The RevIN method is used to restore the prediction results to the original data range to obtain the final fuel cell prediction value:
[0078]
[0079] Step 5.6: For the target variable y t Using quantile regression, the goal is to fit the quantile values by learning the quantile regression loss function Given the target variable y t and predicted values Quantile loss function ρ τ (u) is defined as:
[0080]
[0081] in, is the prediction error, the quantile loss function ρ τ (u) will weight the prediction error u to τ when u ≥ 0, and to τ-1 when u < 0;
[0082] Step 5.7: The goal of quantile regression is to minimize the quantile loss function over all time steps:
[0083]
[0084] here, is the time series feature z output by DeformableTST t The predicted value obtained by quantile regression; by adjusting the model parameters θ, minimize the loss function
[0085] Step 5.8: Process of combining DeformableTST with quantile regression:
[0086] Input time series degradation data:
[0087]
[0088] in: represents time series degradation data, x t represents the degenerate features at time step t, with dimension d, and T represents the length of the time series;
[0089] Objective: Predict the performance metric y at each time step t t for point prediction values and uncertainty prediction intervals:
[0090] Extract high-dimensional temporal feature representations of time series through the embedding layer and encoder of DeformableTST:
[0091]
[0092] Embedding layer: Map the original time series features to a high-dimensional space;
[0093] Encoder: Use the self-attention mechanism to capture the degradation characteristics of the time series and output features which is the extracted temporal feature sequence;
[0094] Step 5.9: Based on the features predict the upper and lower bounds and the median value of the performance metric through the quantile regression layer;
[0095] For each time step t, predict different quantiles of the performance metric y t :
[0096]
[0097] represents the predicted value of the quantile q l , q l is the lower bound of the predicted performance metric, q l = 0.05;
[0098] represents the predicted value of the quantile q u , q u is the upper bound of the predicted performance metric, q u = 0.95;
[0099] represents the predicted value of the median q m = 0.5, q m is the median value (point prediction value) of the predicted performance metric;
[0100] is the quantile regression function, learning the mapping relationship of different quantiles;
[0101] Step 5.10: The optimization objective of quantile regression is to minimize the quantile loss, which measures the error between the predicted value and the true value y t . The quantile loss function is defined as follows:
[0102]
[0103] By adjusting the quantile q, the quantile loss function can capture different degrees of bias: when q is large (q = 0.95), the penalty for underestimation is heavy; when q is small (q = 0.05), the penalty for overestimation is heavy;
[0104] Step 5.11: The sum of the quantile losses is:
[0105]
[0106] Combine the quantile loss with the point prediction loss (such as mean squared error MSE) of DeformableTST to construct the final total loss function of the model:
[0107] L Total = α·L MSE + β·L Quantile
[0108] where: L MSE : measures the mean squared error between the point prediction value and the true value y t :
[0109]
[0110] L Quantile : measures the quantile error of the upper and lower bound predictions; α and β are hyperparameters used to adjust the relative weights of the two parts of the loss;
[0111] The final performance degradation prediction interval is given by the quantile prediction values and :
[0112]
[0113] The prediction interval PI t has a confidence level of q u - q l For example, when q l = 0.05 and q u = 0.95, the confidence interval is 90%.
[0114] Furthermore, in step 6, the model combining DeformableTST and quantile QR regression is optimized by the IPRO algorithm, and the specific implementation process is as follows:
[0115] Step 6.1: The goal is to simultaneously optimize the following three metrics: 1. Minimize the prediction error, (MSE); 2. Maximize the interval coverage rate (PICP, Prediction Interval Coverage Probability); 3. Minimize the prediction interval width; (PINAW, Prediction Interval Normalized Average Width);
[0116] Define the hyperparameter optimization problem as a multi-objective optimization problem:
[0117]
[0118] where Θ: hyperparameters of the model (learning rate of DeformableTST, hidden layer size; loss weights α, β of quantile regression);
[0119] MSE: Mean Squared Error, measuring the error of point prediction;
[0120] PICP: Interval Coverage Rate, measuring whether the prediction interval can cover the true value;
[0121] PINAW: Width of the prediction interval, the narrower the better;
[0122] The formula for point prediction error is as follows:
[0123]
[0124] where: is the median prediction value (point prediction value), y t is the true value;
[0125] Interval Coverage Rate (PICP): The prediction interval coverage rate measures whether the prediction interval can cover the true value and is defined as follows:
[0126]
[0127] where: and are the lower and upper bound prediction values respectively;
[0128] 1(·) is the indicator function, which is 1 if the true value y t falls within the interval and 0 otherwise;
[0129] The goal is to make PICP close to the target confidence level;, for example, 90% (corresponding to q l = 0.05, q u = 0.95).
[0130] Prediction Interval Width (PINAW): The prediction interval width measures the average width of the prediction interval and is defined as follows:
[0131]
[0132] where: R is the range of the performance metric (maximum value minus minimum value), used to normalize the prediction interval width; the narrower the interval width, the smaller the uncertainty of the model, and the goal is to make PINAW as small as possible;
[0133] Step 6.2: IPRO (Improved Partial Reinforcement Optimizer) solves the multi-objective optimization problem through an adaptive learning mechanism and the ability to balance exploration and exploitation:
[0134] Initialize the population Each individual is a set of hyperparameters of the model;
[0135] Initialize the scheduling parameter Schedule and the population fitness F(Θ)
[0136] Step 6.3: Calculate the multi-objective fitness for each combination of hyperparameters:
[0137] F(Θ i ) = w1·MSE(Θ i ) + w2·(1 - PIC P(Θ i )) + w3·PINAW(Θ i )
[0138] where w1, w2, w3 are normalized weights satisfying w1 + w2 + w3 = 1;
[0139] Step 6.4: Update the population using reinforcement learning, and select some combinations of hyperparameters for update:
[0140] The behavior selection rule is based on Schedule, and the hyperparameter with the highest priority is selected for reinforcement; if the model is improved, positive reinforcement is applied, otherwise negative reinforcement is applied;
[0141] The reinforcement update rule is as follows: if improved, positive reinforcement:
[0142]
[0143] If not improved, negative reinforcement:
[0144]
[0145] where RR is the reinforcement rate, representing the magnitude of the reward or punishment;
[0146] Step 6.5: Update the individual hyperparameters Θi :
[0147]
[0148] Among them, SF is the adaptive step size factor;
[0149] Step 6.6: Repeat the above steps until the maximum number of iterations is reached or the fitness function F(Θ) converges; Through the improved IPRO optimization, the optimal set of hyperparameters is obtained:
[0150]
[0151] Furthermore, in step 7, a fuel cell performance degradation prediction interval model based on IPRO-DeformableTST-QR is constructed, with the features after feature selection as the input and the voltage prediction interval as the output:
[0152] Step 7.1: Take the following features of the proton exchange membrane fuel cell (PEMFC) after feature selection, the air inlet flow rate V air,in , the stack voltage U, the current I, the hydrogen inlet flow rate V H2,in , the air inlet humidity H air,in , the hydrogen inlet temperature T H2,in , the hydrogen outlet temperature T H2,out as the input;
[0153] Step 7.2: Construct an IPRO-DeformableTST-QR model to process time series data;
[0154] Input in the model: X t = {V air,in,t , U t , I t , V H2,in,t , H air,in,t , T H2,in,t , T H2,out,t}
[0155] Among them, X t represents the total input of the model at time step t, V air,in,t represents the air inlet flow rate at time step t, U t represents the stack voltage at time step t, I t represents the current at time step t, V H2,in,t represents the hydrogen inlet flow rate at time step t, H air,in,t represents the air inlet humidity at time step t, T H2,in,t represents the hydrogen inlet temperature at time step t, T H2,out,t represents the hydrogen outlet temperature at time step t;
[0156] Step 7.3: The DeformableTST model is used to extract time series features. After the input features pass through the embedding layer and the time series encoder, a hidden representation is generated:
[0157] H t = f DeformableTST (X t ; Θ TST )
[0158] where f DeformableTST : the DeformableTST model, Θ TST : the parameters of the DeformableTST model; the hidden representation, and k is the dimension of the hidden layer;
[0159] Step 7.4: Perform regression on the hidden representation through the quantile regression layer to predict the upper and lower bounds of the specified quantile:
[0160]
[0161] where: f QR : the quantile regression layer; the parameters of the quantile regression layer; q l q u : the quantile, set q l = 0.05, q u = 0.95;
[0162] Step 7.5: Use the improved IPRO to optimize the hyperparameters Θ of the DeformableTST-QR model, where:
[0163]
[0164] Use the improved IPRO optimization algorithm to optimize the model hyperparameters. The goal is to simultaneously minimize MSE, maximize PICP, and minimize PINAW:
[0165] J(Θ) = w1·MSE(Θ) + w2·(1 - PICP(Θ)) + w3·PINAW(Θ)
[0166] Step 7.6: Output the final fuel cell voltage prediction interval:
[0167]
[0168] A fuel cell performance degradation prediction system based on deep learning, including a data acquisition module, a data preprocessing module, a feature selection module, a deep learning model module, a model optimization module, and a prediction result module;
[0169] Data Acquisition Module: This module is responsible for collecting relevant data in real time from various sensors and monitoring devices in the fuel cell system, including but not limited to process variables such as voltage, current, temperature, and pressure. By accurately acquiring various data during the fuel cell operation, it ensures that subsequent processing modules can obtain accurate input data.
[0170] The data preprocessing module combines the simulated annealing isolation forest algorithm and the Gaussian filtering algorithm to preprocess the collected fuel cell data; it is mainly used to eliminate abnormal data and remove noise, improve data quality, and reduce the interference of noise on subsequent prediction processes.
[0171] Feature selection module: SHAP-TCN (SHAP value and temporal convolutional network) is used for feature selection to extract key information related to fuel cell performance degradation from the raw data; thus improving the interpretability and accuracy of the model.
[0172] Deep Learning Model Module: This module combines the DeformableTST (Deformable Time Series Transformer) deep learning model with the quantile regression method to establish a prediction interval for remaining useful life. This model can fully capture the uncertainties that may exist in the prediction process, ensuring that the prediction results are more reliable and accurate.
[0173] Model Optimization Module: By introducing an adaptive regularization weighting method, the Partial Reinforcement Optimizer (IPRO) algorithm is improved to optimize the model's hyperparameters. The optimization objectives include minimizing the prediction error, maximizing the probability of interval coverage (PICP), and minimizing the prediction interval width (PINAW), further improving the model's prediction effect.
[0174] Prediction result module: Based on the IPRO-DeformableTST-QR fuel cell performance degradation prediction interval model, the filtered features are input into the model to output the fuel cell performance degradation prediction interval, that is, the fuel cell output stack voltage interval, thereby providing technical support for predictive maintenance and management of fuel cells.
[0175] Furthermore, the data acquisition module includes a data detection unit and a communication unit. The data detection unit is composed of sensors, instruments, a microprocessor and a communication interface. The microprocessor is a single-chip microcomputer, a CPLD chip, or an FPGA chip. The communication unit is responsible for real-time data transmission and interaction between the data acquisition module and each processing module, the deep learning model module and the host computer through CAN bus technology or high-speed communication protocol.
[0176] Beneficial effects: 1. The data is preprocessed by the simulated annealing isolation forest algorithm and the Gaussian filtering algorithm to remove abnormal data and reduce noise interference, thereby improving the sample quality and ensuring the purity of the data. 2. The SHAP-TCN method is used for feature selection to accurately extract key feature information, ensuring that the model can focus on the most influential parameters. 3. Combining the DeformableTST deep learning model with the quantile regression method to construct a prediction interval for the remaining useful life, effectively capturing the uncertainty in the prediction process and providing a more comprehensive perspective for the prediction. 4. The partial reinforcement optimizer algorithm is improved by the adaptive regularization weighting method to obtain the optimized (IPRO) algorithm, and the model hyperparameters are accurately tuned. BRIEF DESCRIPTION OF THE DRAWINGS
[0177] Figure 1 FIG. is a model framework diagram provided by the present invention based on DeformableTST;
[0178] Figure 2 FIG. is a partial reinforcement optimizer algorithm optimized by the adaptive regularization weighting method provided by the present invention;
[0179] Figure 3 FIG. is a framework diagram of IPRO-DeformableTST-QR provided by the present invention;
[0180] Figure 4 FIG. is a system flowchart provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0181] The technical solutions of the present invention will be further described below with reference to the accompanying drawings.
[0182] Combined with Figure 1 、 Figure 2 and Figure 3, the present invention proposes a method and system for predicting the performance degradation of fuel cells based on deep learning, aiming to improve the prediction accuracy and stability. First, historical operating data of fuel cells are collected, including current, current density, stack voltage, temperature, humidity, and flow rate. The data is preprocessed through a simulated annealing isolation forest algorithm and a Gaussian filtering algorithm to eliminate abnormal data and remove noise, improving the sample quality and reducing noise interference. Then, SHAP-TCN is used for feature selection to extract key information. Next, a prediction interval for performance degradation is constructed by combining the DeformableTST deep learning model and the quantile regression method, so as to comprehensively capture the uncertainty in the prediction process. Further, an adaptive regularization weighted method is used to improve some of the reinforcement optimizer algorithms, and the improved (IPRO) is obtained to tune the hyperparameters of the model. The optimization objectives include minimizing the prediction error, maximizing the interval coverage probability (PICP), and minimizing the prediction interval width (PINAW). This method not only improves the accuracy of the remaining life prediction but also effectively solves the uncertainty problem in traditional methods, has strong engineering application value, and provides a theoretical basis and technical support for the predictive maintenance and management of fuel cells.
[0183] Embodiment of the method:
[0184] Step 1: Collect the historical operating data of the fuel cell and preprocess the data using the simulated annealing isolation forest algorithm to eliminate abnormal data;
[0185] Step 2: Use the Gaussian filtering algorithm to remove noise from the fuel cell data after eliminating abnormal data;
[0186] Step 3: Use the SHAP-TCN method to screen the features of the preprocessed data and extract the features that have the most influence on the performance degradation prediction;
[0187] Step 4: Optimize some of the reinforcement optimizer algorithms PRO (Partial Reinforcement Optimizer, PRO) using the adaptive regularization weighted method to obtain the improved partial reinforcement optimizer algorithm IPRO;
[0188] Step 5: Take the screened features as input, and combine the DeformableTST deep learning model and the quantile regression QR to construct a performance degradation prediction interval to comprehensively capture the uncertainty in the prediction process;
[0189] Step 6: Tune the hyperparameters of the performance degradation prediction model through the improved partial reinforcement optimizer algorithm IPRO. The optimization objectives include minimizing the prediction error, maximizing the interval coverage probability (PICP), and minimizing the prediction interval width (PINAW);
[0190] Step 7: Based on the optimization results, construct a fuel cell performance degradation prediction interval model based on IPRO-DeformableTST-QR, input the selected features into the model, and output the fuel cell performance degradation prediction interval, that is, the fuel cell output stack voltage interval, so as to provide technical support for the predictive maintenance and management of fuel cells.
[0191] Step 1.1: Construction of isolation trees: For each isolation tree, randomly select a fuel cell feature x i and a random splitting point s i of this feature to partition the dataset. Repeat this process until the dataset is isolated into leaf nodes (containing only one data point).
[0192] Step 1.2: Random selection of features: Randomly select a feature from the d-dimensional feature space: x i ∈{x1, x2, …, x d}
[0193] Random selection of splitting points: For feature x i , randomly select a splitting point s i from its value range [min(x i ), max(x i ).
[0194] Recursive splitting: Split the dataset into two parts according to the splitting point s i . If the number of data points in each part is greater than 1, continue splitting; otherwise, stop.
[0195] Step 1.3: Calculate the expected path length: The expected path length E(h(x)) represents the average path length for the data point x to reach the leaf node from the root node. For a tree in the isolation forest, the expected path length is given by the following formula:
[0196]
[0197] where: is the logarithmic function, representing the harmonic number from 1 to n - 1. n is the size of the dataset. For large datasets, E(h(x)) is usually a small value because the path length is short and data points are easily isolated.
[0198] Step 1.4: Isolation degree calculation: The isolation degree is usually measured by the path length. In the isolation forest model, the isolation degree h(x) of the data point x can be calculated by the following formula:
[0199]
[0200] where: h(x) is the path length of the data point x. is a constant of the expected path length. s(x) is the anomaly score. The closer it is to 1, the greater the likelihood that x is an anomaly point.
[0201] Step 1.5: Integrate the Isolation Forest: The Isolation Forest consists of multiple isolation trees (T1, T2,..., T k ), and each tree is constructed by independently randomly selecting features and split points. For the data point x, calculate the path lengths h i (x) on all trees and take their average as the final path length:
[0202]
[0203] Calculate the anomaly score based on the average path length:
[0204] Anomaly points usually have a smaller h(x) corresponding to a larger anomaly score s(x).
[0205] Step 1.6: The Simulated Annealing Algorithm is used to optimize the hyperparameters (the number of trees k, the maximum depth d of the trees, the subsample size) in the Isolation Forest.
[0206] Initialization: Initial temperature: T0, initial hyperparameters: θ0 = {k0, d0, subsample size0}, define the objective func to evaluate the quality of the hyperparameter configuration.
[0207] Objective function: The objective function Evaluate the performance of the Isolation Forest model on the validation set. Assume the model of the Isolation Forest trained with hyperparameters θ is T(θ), and the objective function is: where Error is the error calculated by the evaluation metric (mean squared error).
[0208] Neighborhood generation: In each iteration, Simulated Annealing generates new candidate hyperparameters by perturbing the current hyperparameters θ:
[0209] θ′: θ′ = θ + Δθ
[0210] where Δθ is the perturbation amount, usually selected from a small random range.
[0211] Step 1.7: Probability of accepting a new solution: In Simulated Annealing, it is decided whether to accept a new solution according to the change of the objective function and the current temperature. Assume the objective function value of the current solution is and the objective function value of the new solution is then the probability P(accept) of accepting the new solution is:
[0212]
[0213] where T is the current temperature, is the change in the objective function. As the temperature gradually decreases, it is less likely to accept a solution with a worse objective function.
[0214] Temperature reduction: After each iteration, the temperature T gradually decreases. A commonly used temperature reduction function is:
[0215] T new = α·T old
[0216] where α is the temperature reduction factor (usually between 0.9 and 0.99), which determines the rate of temperature decrease.
[0217] Termination conditions: The maximum number of iterations, the temperature drops below a certain threshold.
[0218] Finally, simulated annealing optimizes the hyperparameters of the isolation forest through iteration, making the objective function reach the minimum value, that is, the optimized hyperparameters can achieve the best anomaly detection effect. Optimal hyperparameters: θ * and the final model: T(θ * ).
[0219] Step 2.1: The core idea of Gaussian filtering is to perform weighted averaging based on the Gaussian distribution. For a one-dimensional signal (fuel cell voltage data), the generated Gaussian function is:
[0220]
[0221] where: G(x) is the value of the Gaussian function at position x, representing the weighting coefficient. σ: Standard deviation, which determines the width of the Gaussian function and reflects the smoothness of the filter. x represents the offset of the filter, usually relative to the current data point.
[0222] Step 2.2: Discretize the continuous Gaussian function into a filter of finite size. For the discrete Gaussian filter of a one-dimensional signal, the discretized formula is:
[0223]
[0224] where k is the half-width of the filter, usually chosen as a small odd value (such as 3, 5, or 7). In this way, the size of the filter is 2k + 1.
[0225] To ensure that the total weight of the filter is 1 and the brightness or amplitude of the signal is not affected, the filter is normalized:
[0226]
[0227] After normalization, the Gaussian filter H′(i) ensures that the sum of the weights is 1.
[0228] Step 2.3: The core of Gaussian filtering is the convolution operation, that is, weighting and averaging the filter with the input data. Assuming that I(t) is the time series of the fuel cell output voltage data, the convolution operation can be expressed as:
[0229]
[0230] where: I(t) is the original fuel cell data at time t. I out (t) is the output data after Gaussian filtering. H′(i) is the normalized Gaussian filter. t + i indicates taking the signal within the window from the original data for weighted averaging.
[0231] Step 3.1: First, preprocess the time series data of the fuel cell. Assume that the dataset of the fuel cell is X = {X1, X2, …, X N}, where where: N is the number of samples, T is the time step, and D is the number of features at each time step (including single cell and stack voltages, currents, current densities, hydrogen inlet and outlet temperatures, air inlet and outlet temperatures, cooling water inlet and outlet temperatures, hydrogen inlet and outlet pressures, air inlet and outlet pressures, hydrogen inlet and outlet flow rates, air inlet and outlet flow rates, cooling water flow rate, and air inlet humidity).
[0232] Step 3.2: The core of TCN is the 1D convolution operation. Assume there is an input At time step t, the output of the TCN model can be expressed as:
[0233] Y t = TCN(X t ) = Conv1D(X t ; W, b)
[0234] where: W is the convolution kernel weight and b is the bias. Through multiple convolutional layers and skip connections, TCN can capture long-term dependencies in the time series.
[0235] The TCN model learns features from the training data. Using a regression task (predicting fuel cell performance degradation), the goal is to minimize the loss function (mean squared error):
[0236]
[0237] where Y i is the actual output, is the model predicted output.
[0238] Step 3.3: SHAP values are used to explain the contribution of each feature in the model to the prediction result. Assuming that the output of the trained TCN model f for an input sample x is f(x), the SHAP value can be expressed as:
[0239]
[0240] where: x S represents the feature subset after removing feature x j and x j is feature j, and is all possible feature subsets. The SHAP value measures the contribution of feature j to the model output. For time series data, the SHAP value usually needs to be calculated at multiple time steps. Therefore, the SHAP value of the features at each time step needs to be calculated and summed up to obtain the global feature importance.
[0241] Step 3.4: Calculate the SHAP values of all features and rank the importance of each feature in the fuel cell data. Set a threshold ∈, and select the features with SHAP values greater than the threshold as important features. Assuming that for each feature x j of the fuel cell, its SHAP value is φ j (f, x), the feature selection can be carried out according to the following steps:
[0242]
[0243] where is the set of selected features.
[0244] Step 4.1: Initialize the population X = {X1, X2, …, X P} where each individual X i is a solution containing N behavioral variables (decision variables):
[0245] X i = {X i,1 , X i,2 , …, X i,N} for i = 1, 2, …, P
[0246] Step 4.2: Initialize the schedule: Schedule = {Schedule1, Schedule2, …, Schedule N} which represents the priority of each behavioral variable.
[0247] Set the maximum number of function evaluations MaxFEs, reinforcement rate RR, population size P, regularization parameter λ, and learning rate η0.
[0248] Step 4.3: The time factor τ: used to measure the progress of the current iteration process:
[0249]
[0250] Among them, FEs is the current number of function evaluations, and MaxFEs is the maximum number of function evaluations.
[0251] Step 4.4: Select the rate SR: gradually decrease as the iteration process progresses, which is used to control the probability of selecting behavioral variables:
[0252] SR = e (1-τ)
[0253] Step 4.5: For each behavioral variable, introduce an adaptive weight ω j , which is used to measure the relative importance of different behavioral variables:
[0254]
[0255] Among them, Std(X j ): represents the standard deviation of behavioral variable j, which is used to characterize its variation range in the population.
[0256] Normalization term restricts the weight range to [0, 1].
[0257] Step 4.6: According to the schedule and the selection rate, select a set of behavioral variables μ:
[0258] μ = {j∣Schedule j ≥Schedule *},
[0259] Among them, Schedule j : the scheduling priority of behavioral variable j. Schedule * : the threshold in the schedule, usually selected as the mean value or a certain proportion of the current schedule.
[0260] Step 4.7: After adding the adaptive weight ω j , the stimulation factor SF i is updated to:
[0261]
[0262] The behavioral variable is updated according to the following formula: [[ID=6,3]]
[0263]
[0264] Direction factor
[0265]
[0266] Among them, is the current optimal solution.
[0267] Learning rate η: η = η0·e -τ The initial learning rate η0 is relatively large and gradually decreases as the iteration process progresses.
[0268] Regularization term:
[0269]
[0270] Among them, λ is the regularization coefficient, which is dynamically adjusted as:
[0271]
[0272] Step 4.8: After the behavior variables are updated, update the schedule based on the reinforcement learning mechanism:
[0273] Positive reinforcement (if the new solution is better):
[0274] Negative reinforcement (if the new solution is not better):
[0275] Positive reinforcement increases the priority, and negative reinforcement decreases the priority. The weight ω j determines the amplitude of the schedule update.
[0276] Step 4.9: Introduce a dynamic reset mechanism for the behavior variables and the schedule:
[0277] If the standard deviation of the schedule is lower than the threshold, reset the schedule:
[0278]
[0279] If the standard deviation of the behavior variables is lower than the threshold, reset the behavior variables:
[0280]
[0281] When FEs ≥ MaxFEs or other termination conditions are met, output the current optimal solution X best .
[0282] Step 5.1: Input the fuel cell time series into the DeformableTST deep learning model: Among them, B is the batch size, I is the input sequence length, and M is the number of features.
[0283] Output the prediction sequence: Among them, is the T output sequence length.
[0284] L is the number of DeformableTST blocks, D iThe feature embedding dimension in the i-th block, N i The length of the time series feature in the i-th block, Use_Downsampling: Whether to use downsampling.
[0285] Step 5.2: Normalize the input sequence using the Reverse Instance Normalization (RevIN) method:
[0286] X in = RevIN(X in , mode = norm)
[0287] Transpose the input tensor to fit the model calculation dimension:
[0288] (Adjust to dimension )
[0289] Reshape the input data:
[0290] X in = reshape(X in )
[0291] Step 5.3: Embed the input sequence into a deformable-coded feature representation: X0 = Embedding(X in ) where,
[0292] Step 5.4: Iteration of the DeformableTST block: For each i = 1, …, L, perform the following steps:
[0293] Local Perception Unit (LPU): Extract local temporal information:
[0294] where,
[0295] Deformable Attention: Utilize deformable attention to extract global temporal information:
[0296]
[0297] where,
[0298] Feed-Forward Network (FFN): Learn local information and new feature representations through a feed-forward network with depthwise convolution:
[0299]
[0300] where,
[0301] Step 5.5: Output layer: In the last layer L, reshape the embedding representation into the target shape:
[0302] X L = reshape(X L )(reshape back to )
[0303] Predict the target sequence through a fully connected layer:
[0304]
[0305] where,
[0306] Use the Reverse Instance Normalization (RevIN) method to restore the prediction result to the original data range to obtain the final fuel cell prediction value:
[0307]
[0308] Step 5.6: For the target variable y t Use quantile regression. The goal is to fit the quantile values by learning the quantile regression loss function
[0309] Quantile loss function: Given the target variable y t and the predicted value The quantile loss function ρ τ (u) is defined as:
[0310]
[0311] where, is the prediction error. The quantile loss function ρ τ (u) will weight the prediction error u as τ when u ≥ 0, and weight it as τ - 1 when u < 0.
[0312] Step 5.7: Optimization objective of quantile regression: The objective of quantile regression is to minimize the quantile loss function for all time steps:
[0313]
[0314] Here, is the time series feature z output based on DeformableTST t The predicted value obtained through quantile regression. By adjusting the model parameters θ, minimize the loss function
[0315] Step 5.8: Process of Combining DeformableTST with Quantile Regression:
[0316] Input the time series degradation data:
[0317]
[0318] Where: represents the time series degradation data. x t represents the degradation feature at time step t, with dimension d, and T represents the length of the time series.
[0319] Objective: Predict the point prediction value and uncertainty prediction interval of the performance metric y t at each time step t:
[0320] Extract the high-dimensional temporal feature representation of the time series through the embedding layer and encoder of DeformableTST:
[0321]
[0322] Embedding layer: Map the original time series features to a high-dimensional space;
[0323] Encoder: Use the self-attention mechanism to capture the degradation characteristics of the time series and output the feature which is the extracted temporal feature sequence.
[0324] Step 5.9: Based on the feature predict the upper and lower bounds and the median value of the performance metric through the quantile regression layer.
[0325] For each time step t, predict different quantiles of the performance metric y t :
[0326]
[0327] The predicted value (lower bound) of the quantile q l , q l = 0.05;
[0328] The predicted value (upper bound) of the quantile q u , q u = 0.95;
[0329] The predicted value (point prediction value) of the median q m = 0.5;
[0330] It is a quantile regression function that learns the mapping relationship between different quantiles.
[0331] Step 5.10: The optimization goal of quantile regression is to minimize the quantile loss, which measures the predicted value. and the true value y t The error between , the quantile loss function is defined as follows:
[0332]
[0333] By adjusting the quantile q, the quantile loss function can capture different degrees of bias: a larger q (q = 0.95) will penalize underestimation more severely, and a smaller q (q = 0.05) will penalize overestimation more severely. Step 5.11: The sum of the quantile losses is:
[0334]
[0335] Combine the quantile loss with the point prediction loss of DeformableTST (such as mean squared error MSE) to construct the final total loss function of the model:
[0336] L Total =α·L MSE +β·L Quantile
[0337] Where: L MSE : Measure point forecast value and the true value y t The mean square error of:
[0338]
[0339] L Quantile : Measures the quantile error of the upper and lower bound predictions. α and β are hyperparameters that adjust the relative weight of the two parts of the loss.
[0340] The final performance degradation prediction interval is determined by the quantile prediction value and gives:
[0341]
[0342] Where: q l : The predicted lower bound of the performance indicator, q u : The predicted upper bound of the performance indicator.
[0343] Prediction interval PI t The confidence level is q u -q l , for example, q l =0.05,q u =0.95, with a confidence interval of 90%.
[0344] Step 6.1: The goal is to simultaneously optimize the following three metrics: 1. Minimize the prediction error (MSE), 2. Maximize the prediction interval coverage probability (PICP), and 3. Minimize the prediction interval normalized average width (PINAW).
[0345] Define the hyperparameter optimization problem as a multi-objective optimization problem:
[0346]
[0347] Where: Θ: Hyperparameters of the model (learning rate of DeformableTST, hidden layer size; loss weights α, β of quantile regression);
[0348] MSE: Mean squared error, measuring the error of point prediction;
[0349] PICP: Prediction interval coverage probability, measuring whether the prediction interval can cover the true value;
[0350] PINAW: Width of the prediction interval, the narrower the better.
[0351] The formula for point prediction error is as follows:
[0352]
[0353] Where: is the median predicted value (point prediction value), y t is the true value.
[0354] Prediction interval coverage probability (PICP): The prediction interval coverage probability measures whether the prediction interval can cover the true value and is defined as follows:
[0355]
[0356] Where: and are the lower and upper bound predicted values respectively;
[0357] 1(·) is the indicator function, which is 1 if the true value y t falls within the interval and 0 otherwise.
[0358] The goal is to make PICP close to the target confidence level, such as 90% (corresponding to q l = 0.05, q u = 0.95).
[0359] Prediction Interval Width (PINAW): The prediction interval width measures the average width of the prediction interval and is defined as follows:
[0360]
[0361] Where: R is the range of the performance metric (maximum value minus minimum value), used to normalize the prediction interval width; the narrower the interval width, the less uncertainty in the model, and the goal is to make PINAW as small as possible.
[0362] Step 6.2: IPRO (Improved Partial Reinforcement Optimizer) is an optimization algorithm. Its improved version solves multi-objective optimization problems through an adaptive learning mechanism and the ability to balance exploration and exploitation:
[0363] Initialize the population Each individual is a set of hyperparameters of the model;
[0364] Initialize the scheduling parameter Schedule and the population fitness F(Θ)
[0365] Step 6.3: Calculate the multi-objective fitness for each hyperparameter combination:
[0366] F(Θ i ) = w1·MSE(Θ i ) + w2·(1 - PIC P(Θ i )) + w3·PINAW(Θ i )
[0367] Where w1, w2, w3 are normalized weights satisfying w1 + w2 + w3 = 1
[0368] Step 6.4: Update the population using reinforcement learning, and select some hyperparameter combinations for update:
[0369] The behavior selection rule is based on Schedule, and the hyperparameter with the highest priority is selected for reinforcement; if the model is improved, positive reinforcement is applied, otherwise negative reinforcement is applied.
[0370] The reinforcement update rule is as follows: Positive reinforcement (if improved):
[0371]
[0372] Negative reinforcement (if not improved):
[0373]
[0374] Where RR is the reinforcement rate, representing the magnitude of the reward or punishment.
[0375] Step 6.5: Update the individual hyperparameter Θ i :
[0376]
[0377] Among them, SF is the adaptive step size factor, which controls the balance between exploration and exploitation.
[0378] Step 6.6: Repeat the above steps until the maximum number of iterations is reached or the fitness function F(Θ) converges. Through the improved IPRO optimization, the optimal hyperparameter set is obtained:
[0379]
[0380] Step 7.1: Take the following characteristics of the proton exchange membrane fuel cell (PEMFC) after feature selection: air inlet flow rate V air,in , stack voltage U, current I, hydrogen inlet flow rate V H2,in , air inlet humidity H air,in , hydrogen inlet temperature T H2,in , hydrogen outlet temperature T H2,out as the input.
[0381] Step 7.2: Construct the IPRO-DeformableTST-QR model to process time series data.
[0382] Input in the model: X t ={V air,in,t ,U t ,I t ,V H2,in,t ,H air,in,t ,T H2,in,t ,T H2,out,t}
[0383] Among them, X t represents the total input of the model at time step t, V air,in,t represents the air inlet flow rate at time step t, U t represents the stack voltage at time step t, I t represents the current at time step t, V H2,in,t represents the hydrogen inlet flow rate at time step t, H air,in,t represents the air inlet humidity at time step t, T H2,in,t represents the hydrogen inlet temperature at time step t, T H2,out,t represents the hydrogen outlet temperature at time step t.
[0384] Step 7.3: The DeformableTST model is used to extract time series features. After the input features pass through the embedding layer and the time series encoder, hidden representations are generated:
[0385] H t = f DeformableTST (X t ; Θ TST )
[0386] where f DeformableTST : DeformableTST model, Θ TST : Parameters of the DeformableTST model; Hidden representation, where k is the dimension of the hidden layer.
[0387] Step 7.4: Regress the hidden representation through the quantile regression layer to predict the upper and lower bounds of the specified quantile:
[0388]
[0389] where: f QR : Quantile regression layer; Parameters of the quantile regression layer; q l q u : Quantile, set q l = 0.05, q u = 0.95.
[0390] Step 7.5: Use the improved IPRO to optimize the hyperparameters Θ of the DeformableTST-QR model, where:
[0391]
[0392] Use the improved IPRO optimization algorithm to optimize the model hyperparameters, with the goal of simultaneously minimizing MSE, maximizing PICP, and minimizing PINAW:
[0393] J(Θ) = w1·MSE(Θ) + w2·(1 - PICP(Θ)) + w3·PINAW(Θ)
[0394] Step 7.6: Output the final fuel cell voltage prediction interval:
[0395]
[0396] This system embodiment:
[0397] As Figure 4 shown, a fuel cell performance degradation prediction system based on deep learning includes the following modules:
[0398] Data acquisition module: This module is responsible for collecting relevant data in real time from various sensors and monitoring devices in the fuel cell system, including but not limited to process variables such as voltage, current, temperature, and pressure. By accurately obtaining various data during the operation of the fuel cell, it ensures that the subsequent processing module can obtain accurate input data.
[0399] Data preprocessing module: This module preprocesses the collected fuel cell data by combining the simulated annealing isolation forest algorithm and the Gaussian filtering algorithm, mainly used to eliminate abnormal data and remove noise, improve data quality, and reduce the interference of noise on the subsequent prediction process.
[0400] Feature selection module: SHAP-TCN (SHAP value and temporal convolutional network) is used for feature selection to extract key information related to the performance degradation of the fuel cell from the original data, improving the interpretability and accuracy of the model.
[0401] Deep learning model module: Combining the DeformableTST (deformable temporal transformation network) deep learning model with the quantile regression method to establish a prediction interval for the remaining useful life. This model can comprehensively capture the uncertainties that may exist in the prediction process, ensuring that the prediction results are more reliable and accurate.
[0402] Model optimization module: By introducing an adaptive regularization weighting method and improving the Improved Partial Reinforcement Optimizer (IPRO) algorithm to optimize the hyperparameters of the model. The optimization objectives include minimizing the prediction error, maximizing the Prediction Interval Coverage Probability (PICP), and minimizing the Prediction Interval Normalized Average Width (PINAW), further improving the prediction effect of the model.
[0403] Prediction result module: Finally, the remaining useful life prediction results output by this method not only have higher accuracy but also can effectively address the common uncertainty problems in traditional methods. The predicted interval provides a more comprehensive risk assessment, ensuring more scientific predictive maintenance and management of fuel cells.
[0404] Furthermore, the data acquisition module includes a data detection unit and a communication unit. The detection unit consists of various sensors, instruments, microprocessors, and communication interfaces. The microprocessor can be selected from single-chip microcomputers, CPLD chips, FPGA chips, etc., to ensure real-time and accurate acquisition of various operating data of the fuel cell, such as key indicators like voltage, current, temperature, and pressure;
[0405] Furthermore, the communication unit is responsible for real-time data transmission and interaction between the data acquisition module and each processing module, the deep learning model module, and the host computer through CAN bus technology or other high-speed communication protocols, ensuring that the system can efficiently and stably transfer and process data.
Claims
1. A method for predicting the performance degradation of a fuel cell based on deep learning, characterized in that, Including: Step 1: Collect the historical operation data of the fuel cell and preprocess the data using the simulated annealing isolation forest algorithm; Step 2: Use the Gaussian filtering algorithm to remove noise from the fuel cell data with abnormal data removed; Step 3: Use the SHAP-TCN method to perform feature screening on the preprocessed data and extract the features most influential for performance degradation prediction; Step 4: Optimize the partial reinforcement optimizer algorithm PRO using the adaptive regularization weighting method to obtain the improved partial reinforcement optimizer algorithm IPRO; Step 5: Take the screened features as inputs, combine the DeformableTST deep learning model with the quantile regression QR to construct a performance degradation prediction interval; Step 6: Tune the hyperparameters of the performance degradation prediction model through the improved partial reinforcement optimizer algorithm IPRO, and the optimization objectives include minimizing the prediction error, maximizing the interval coverage rate, and minimizing the prediction interval width; Step 7: Based on the optimization results, construct a fuel cell performance degradation prediction interval model based on IPRO-DeformableTST-QR, input the screened features into the model, and output the fuel cell performance degradation prediction interval, that is, the fuel cell output stack voltage interval, so as to provide technical support for the predictive maintenance and management of the fuel cell.
2. The method for predicting the performance degradation of a proton exchange membrane fuel cell based on a neural network according to claim 1, characterized in that The simulated annealing isolation forest algorithm combines the simulated annealing and isolation forest algorithms, and uses the simulated annealing algorithm to optimize the hyperparameters in the isolation forest. The hyperparameters include the number of trees k, the maximum depth d of the tree, and the subsample size; Initial hyperparameters: θ0 = {k0, d0, subsample size0}, defining the objective function for evaluating the performance of the Isolation Forest model on the validation set; assume the model trained by the Isolation Forest using hyperparameters θ is T(θ), and the objective function is: where Error is the error calculated by the evaluation metric; In each iteration, simulated annealing generates new candidate hyperparameters by perturbing the current hyperparameters θ: Finally, simulated annealing iteratively optimizes the hyperparameters of the Isolation Forest to minimize the objective function to its minimum value, that is, the optimized hyperparameters can achieve the best anomaly detection effect; Optimal hyperparameters: θ * , Final model: T(θ * ).
3. A method for predicting the performance degradation of a fuel cell based on deep learning according to claim 1, characterized in that, The step 2 uses the Gaussian filtering algorithm to remove noise from the fuel cell data with abnormal data removed, including: Gaussian filtering performs weighted averaging of the filter and the input data. Assuming that I(t) is the time series of the fuel cell output voltage data, the convolution operation is expressed as: Where: I(t) is the original fuel cell data at time t; I out (t) is the output data after Gaussian filtering; H′(i) is the normalized Gaussian filter; t + i represents taking the signal within the window from the original data for weighted averaging, k is the half-width of the filter, and i = -k, -k + 1, …, k.
4. A method for predicting the performance degradation of a fuel cell based on deep learning according to claim 1, wherein The step 3 uses the SHAP-TCN method to perform feature screening on the preprocessed data: The SHAP value is used to explain the contribution of each feature to the prediction result in the TCN model. Assuming that the output of the trained TCN model f for an input sample x is f(x), the SHAP value can be expressed as: where: x S represents the feature subset obtained by removing feature x j , x j is feature j is all possible feature subsets indicates that set S is sampled from all possible feature subsets ; The SHAP value measures the contribution of feature j to the model output; For time series data, the SHAP value usually needs to be calculated at multiple time steps. Therefore, the SHAP value needs to be calculated for the features at each time step and summed to obtain the global feature importance; Calculate the SHAP values of all features, and rank the importance of each feature in the fuel cell data; set a threshold ∈, and select the features with SHAP values greater than the threshold as important features. Assume that for each feature x of the fuel cell j , its SHAP value is φ j (f, x), and perform feature selection according to the following steps: Among them, is the selected feature set.
5. A method for predicting the performance degradation of a fuel cell based on deep learning according to claim 1, characterized in that, In the step 4, the adaptive regularization weighting method is used to optimize the partial reinforcement optimizer algorithm PRO to obtain the improved partial reinforcement optimizer algorithm IPRO. The process is as follows: Initialize the population X = {X1, X2, …, X P}, where the population size is P, and each individual X i is a solution containing N behavioral variables: X i = {X i,1 , X i,2 , …, X i,N}, i = 1, 2, …, P Initialize the scheduling table Schedule = {Schedule1, Schedule2, …, Schedule N}, which represents the priority of each behavioral variable; set the regularization parameter λ and the learning rate η0; the time factor τ is used to measure the progress of the current iteration process; the selection rate SR is used to control the probability of selecting behavioral variables; For each behavioral variable, an adaptive weight ω is introduced j , which is used to measure the relative importance of different behavioral variables: where, Std(X j ): represents the standard deviation of behavioral variable j, which is used to characterize its variation range in the population. The normalization term restricts the weight range to [0, 1]; Select a set of action variables μ according to the schedule and selection rate: μ = {j | Schedule j ≥ Schedule ★}, Among them, Schedule j : The scheduling priority of behavior variable j, Schedule ★ : The threshold value in the scheduling table; Add the adaptive weight ω j After that, the stimulation factor SF i Is updated to: U(0,β) represents the uniform distribution on the interval [0,β]; The action variables are updated according to the following formula: Direction factor Among them, is the current optimal solution, and η and α are learning rates; η = η0·e -τ , the initial learning rate η0 is relatively large and gradually decreases as the iteration process progresses; Regularization term: where λ is the regularization coefficient, which is dynamically adjusted as: X all is the set of behavioral variables of all individuals; After the action variables are updated, the schedule is updated based on the reinforcement learning mechanism: If the new solution is better, positive reinforcement: If the new solution is not better, negative reinforcement: Positive reinforcement increases the priority, negative reinforcement decreases the priority, and the weight ω j determines the amplitude of the schedule update; the reinforcement rate RR; If the standard deviation of the schedule is lower than the threshold, reset the schedule: If the standard deviation of the action variables is lower than the threshold, reset the action variables: L B ,U B is the behavioral variable X i The lower and upper bounds at reset, FEs is the current number of function evaluations, MaxFEs is the maximum number of function evaluations. When FEs ≥ MaxFEs or other set termination conditions are met, the current optimal solution X is output best .
6. The fuel cell performance degradation prediction method based on deep learning according to claim 1, wherein, The step 5 takes the screened features as inputs, combines the DeformableTST deep learning model with the quantile regression method, and the specific process of constructing the performance degradation prediction interval is as follows: Step 5.1: Input the fuel cell time series into the DeformableTST deep learning model: where B is the batch size, I is the input sequence length, and M is the number of features; Output prediction sequence: where is the output sequence length of T; Step 5.2: Use the inverse normalization method to standardize the input sequence: X in = RevIN(X in , mode = norm) mode = norm represents normalization; Transpose the input tensor to adapt to the model calculation dimension: Reshape the input data: X in = reshape(X in ) Step 5.3: Embed the input sequence into a deformed-encoded feature representation: X0 = Embedding(X in ) where, D i is the feature embedding dimension in the i-th block, and N i is the length of the time series feature in the i-th block; Embedding represents embedding; Step 5.4: Iterate the DeformableTST block to extract local temporal information, use deformable attention to extract global temporal information, and learn local information and new feature representations through a feed-forward network with depthwise convolution; Step 5.5: In the last layer, reshape the embedding representation into the target shape: X L = reshape(X L ) Predict the target sequence through a fully connected layer: Among them, L is the number of DeformableTST blocks, Use the inverse normalization method to restore the prediction result to the original data range to obtain the final fuel cell prediction value: Step 5.6: For the target variable y t Use quantile regression, with the goal of fitting quantile values by learning the quantile regression loss function Step 5.7: Given the target variable y t and the predicted value the quantile loss function ρ τ (u); the goal of quantile regression is to minimize the quantile loss function for all time steps: Here, is the time series feature z output based on DeformableTST t The predicted value obtained through quantile regression; by adjusting the model parameter θ, minimizing the loss function Step 5.8: The process of combining DeformableTST and quantile regression: Input the degraded data of the time series: Wherein: represents time series degradation data, and x t represents the degradation feature at time step t, with a dimension of d, and T represents the length of the time series; Objective: Predict the performance metric y at each time step t t for point predictions and uncertainty prediction intervals: Extract the high-dimensional temporal feature representation of the time series through the embedding layer and encoder of DeformableTST: Embedding layer: Map the original time series features into a high-dimensional space; Encoder: Using the self-attention mechanism to capture the degradation characteristics of time series and output features is the extracted time series feature sequence; Step 5.9: Based on the feature , predict the upper and lower bounds and the median value of the performance metric through the quantile regression layer; For each time step t, the different quantiles of the prediction performance metric y t are: Denote the predicted value of the quantile q l , where q l is the lower bound of the prediction performance metric; Denote the quantile q u of the predicted value, where q u is the upper bound of the prediction performance metric; Denote the median q m as the predicted value, where q m is the median of the prediction performance metric; is the quantile regression function, learning the mapping relationships of different quantiles; Step 5.10: The optimization objective of quantile regression is to minimize the quantile loss, which measures the error between the predicted value and the true value y t The quantile loss function is defined as follows: By adjusting the quantile q, the quantile loss function can capture different degrees of deviation: when q is larger, the penalty for underestimation is heavier; when q is smaller, the penalty for overestimation is heavier; Step 5.11: The sum of the quantile losses is: Combine the quantile loss with the point prediction loss of DeformableTST to construct the final total loss function of the model: L Total = α · L MSE + β · L Quantile where: L MSE : mean squared error measuring the point prediction value and the true value y t : L Quantile : Quantile error for measuring upper and lower bound predictions; α and β are hyperparameters used to adjust the relative weights of the two-part loss; The final performance degradation prediction interval is given by the quantile prediction values and as follows: Prediction interval PI t with confidence q u -q l .
7. A method for predicting the performance degradation of a fuel cell based on deep learning according to claim 1, characterized in that, In step 6, the model combining DeformableTST and quantile QR regression is optimized by the IPRO algorithm. The specific implementation process is as follows: Step 6.1: The goal is to optimize the following three metrics simultaneously: minimize the prediction error MSE, maximize the interval coverage rate PICP, and minimize the prediction interval width PINAW; Define the hyperparameter optimization problem as a multi-objective optimization problem: Among them, Θ: the hyperparameters of the model; MSE: mean square error, measuring the error of point prediction; PICP: interval coverage rate, measuring whether the prediction interval can cover the true value; PINAW: the width of the prediction interval, the narrower the better; The formula for the point prediction error is as follows: Wherein: is the median predicted value, y t is the true value; Interval coverage rate: The prediction interval coverage rate measures whether the prediction interval can cover the true value and is defined as follows: Wherein: and are the predicted values of the lower bound and the upper bound respectively; 1(·) is an indicator function that is 1 if the true value y t falls within the interval and 0 otherwise; The goal is to make PICP close to the target confidence level; Interval width: The prediction interval width measures the average width of the prediction interval and is defined as follows: Among them: R is the range of the performance metric, used to normalize the prediction interval width; the narrower the interval width, the smaller the uncertainty of the model. The goal is to make PINAW as small as possible; Step 6.2: IPRO solves the multi-objective optimization problem through an adaptive learning mechanism and the ability to balance exploration and exploitation: Initialize the population Each individual is a set of hyperparameters of the model; Initialize the scheduling parameter Schedule and the population fitness value F(Θ) Step 6.3: Calculate the multi-objective fitness for each combination of hyperparameters: F(Θ i ) = w1·MSE(Θ i ) + w2·(1 - PIC(Θ i )) + w3·PINAW(Θ i ) It should be noted that there may be some inaccuracies in the original text as "PICP" in the original is likely a misspelling and should probably be "PICP" (Predicted Intervals Coverage Probability). The above translation is based on the text provided. Among them, w1, w2, w3 are normalized weights, satisfying w1 + w2 + w3 = 1; Step 6.4: Update the population using reinforcement learning and select some combinations of hyperparameters for update: The behavior selection rule is based on Schedule, and the hyperparameter with the highest priority is selected for reinforcement; if the model is improved, positive reinforcement is applied, otherwise negative reinforcement is applied; The reinforcement update rule is as follows: if improved, positive reinforcement: Without improvement, negative reinforcement: where RR is the reinforcement rate, representing the magnitude of reward or punishment; Step 6.5: Update the individual hyperparameter Θ i : where SF is the adaptive step size factor; Step 6.6: Repeat the above steps until the maximum number of iterations is reached or the fitness function F(Θ) converges; through improved IPRO optimization, obtain the optimal set of hyperparameters:
8. A method for predicting the performance degradation of a fuel cell based on deep learning according to claim 1, characterized in that, In step 7, construct a fuel cell performance degradation prediction interval model based on IPRO-DeformableTST-QR, with the features after feature selection as the input and the voltage prediction interval as the output: Step 7.1: Take the following features of the proton exchange membrane fuel cell after feature selection: air inlet flow rate V air,in , stack voltage U, current I, hydrogen inlet flow rate V H2,in , air inlet humidity H air,in , hydrogen inlet temperature T H2,in , hydrogen outlet temperature T H2,out as inputs; Step 7.2: Construct an IPRO-DeformableTST-QR model to process time series data; Input in the model: X t = {V air,in,t , U t , I t , V H2,in,t , H air,in,t , T H2,in,t , T H2,out,t} Among them, X t represents the total input of the model at time step t, V air,in,t represents the air inlet flow rate at time step t, U t represents the stack voltage at time step t, I t represents the current at time step t, V H2,in,t represents the hydrogen inlet flow rate at time step t, H air,in,t represents the air inlet humidity at time step t, T H2,in,t represents the hydrogen inlet temperature at time step t, T H2,out,t represents the hydrogen outlet temperature at time step t; Step 7.3: The DeformableTST model is used to extract time series features. After the input features pass through the embedding layer and the time series encoder, hidden representations are generated: H t = f DeformableTST (X t ; Θ TST ) Among them, f DeformableTST : DeformableTST model, Θ TST : Parameters of the DeformableTST model; Hidden representation, where k is the dimension of the hidden layer; Step 7.4: Perform regression on the hidden representations through the quantile regression layer to predict the upper and lower bound values of the specified quantile: where: f QR : quantile regression layer; parameters of the quantile regression layer; q l q u : quantile; Step 7.5: Use the improved IPRO to optimize the hyperparameters Θ of the DeformableTST-QR model, where: Utilize the improved IPRO optimization algorithm to optimize the model hyperparameters, with the goal of simultaneously minimizing MSE, maximizing PICP, and minimizing PINAW: J(Θ) = w1·MSE(Θ) + w2·(1 - PICP(Θ)) + w3·PINAW(Θ) Step 7.6: Output the final fuel cell voltage prediction interval:
9. A fuel cell performance degradation prediction system based on deep learning, characterized in that, Including a data acquisition module, a data preprocessing module, a feature selection module, a deep learning model module, a model optimization module, and a prediction result module; Data acquisition module: This module is responsible for collecting relevant data in real time from various sensors and monitoring devices in the fuel cell system; Data preprocessing module, which preprocesses the collected fuel cell data by combining the simulated annealing isolation forest algorithm and the Gaussian filtering algorithm; Feature selection module: Use SHAP-TCN for feature selection to extract key information related to fuel cell performance degradation from the original data; Deep learning model module: Combine the DeformableTST deep learning model with the quantile regression method to establish a prediction interval for the remaining useful life; Model optimization module: By introducing an adaptive regularization weighting method, improve the partial reinforcement optimizer IPRO algorithm to optimize the model hyperparameters; the optimization objectives include minimizing the prediction error, maximizing the interval coverage rate PICP, and minimizing the prediction interval width PINAW; Prediction result module: Based on the fuel cell performance degradation prediction interval model of IPRO-DeformableTST-QR, input the selected features into the model, and output the fuel cell performance degradation prediction interval, that is, the fuel cell output stack voltage interval, so as to provide technical support for the predictive maintenance and management of fuel cells.
10. A fuel cell performance degradation prediction system based on deep learning according to claim 9, characterized in that, The data acquisition module includes a data detection unit and a communication unit. The data detection unit consists of sensors, instruments, microprocessors, and communication interfaces. The microprocessor can be a single-chip microcomputer, a CPLD chip, or an FPGA chip. The communication unit is responsible for the real-time data transmission and interaction between the data acquisition module and each processing module, the deep learning model module, and the host computer through CAN bus technology or high-speed communication protocols.
Citation Information
Cited By
Two-stage gasifier outlet hydrogen dynamic prediction method and system
CN121191612A