Method and system for predicting aging trend and residual life of proton exchange membrane fuel cell, and storage medium
By combining variable-scale one-dimensional convolution kernels and adaptive pooling techniques with aging feature attention masks and adaptive genetic operators, the problems of feature loss and insufficient optimization in the prediction of aging trends and remaining life of proton exchange membrane fuel cells are solved, and more accurate predictions are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KUNMING UNIV OF SCI & TECH
- Filing Date
- 2026-04-09
- Publication Date
- 2026-05-08
AI Technical Summary
Traditional methods for predicting the aging trend and remaining life of proton exchange membrane fuel cells suffer from problems such as feature loss, computational redundancy, low capture efficiency due to long-distance dependence, and insufficient optimization accuracy.
We employ variable-scale one-dimensional convolution kernels and adaptive pooling techniques to extract features from time-series data. By combining aging feature attention masks and adaptive genetic operators, we optimize the prediction model to capture aging trend features.
It improves the prediction accuracy of proton exchange membrane fuel cells, enabling accurate prediction of aging trends and remaining lifespan.
Smart Images

Figure CN121995239A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, system and storage medium for predicting the aging trend and remaining life of a proton exchange membrane fuel cell. Background Technology
[0002] With the promotion of hydrogen energy applications, the remaining useful life (RUL) prediction of proton exchange membrane fuel cells (PEMFCs), as clean energy conversion devices, is crucial for maintaining system reliability.
[0003] Traditional battery prediction methods, such as CNN-Transformer joint feature extraction and genetic algorithm parameter optimization, present some technical challenges when applied to the aging trend and RUL prediction scenario in PEMFC:
[0004] On the one hand, PEMFC time-series data is characterized by non-stationarity, strong noise, and time-varying features, making it easy to lose key local features due to aging. Traditional CNN's fixed convolution kernel and pooling strategies are not suitable for it. On the other hand, the traditional Transformer's self-attention mechanism suffers from computational redundancy and low efficiency in capturing long-distance dependencies when processing long-term PEMFC data. Furthermore, traditional genetic algorithms are prone to getting trapped in local optima when optimizing model hyperparameters and feature sets, and the fixed parameters of crossover and mutation operators cannot adapt to the heterogeneous characteristics of multiple features in PEMFC, resulting in insufficient optimization accuracy and efficiency.
[0005] In view of this, this application proposes a new method for predicting the aging trend and remaining life of proton exchange membrane fuel cells, aiming to overcome the above-mentioned defects and improve the prediction accuracy of proton exchange membrane fuel cells. Summary of the Invention
[0006] The main objective of this application is to provide a method for predicting the aging trend and remaining life of proton exchange membrane fuel cells, aiming to solve the problem of how to improve the prediction accuracy of proton exchange membrane fuel cells.
[0007] To achieve the above objectives, this application provides a method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell, the method comprising the following steps:
[0008] S10: Input the collected time-series data of the proton exchange membrane fuel cell under test into the pre-trained prediction model;
[0009] The pre-trained prediction model includes:
[0010] The feature extraction layer uses a variable-scale one-dimensional convolution kernel function to determine the adaptive sliding window corresponding to the time-varying features in the time-series data of the proton exchange membrane fuel cell, and then pools downsamples the local features of the time-series data within the adaptive sliding window.
[0011] In the encoding layer, an aging feature attention mask is used to shield the attention calculation process of redundant segments in the time series data. The number of attention heads that are positively correlated with the time scale are assigned to non-redundant segments for aging feature capture. The size of the weight matrix of the feedforward network is determined according to the activation intensity of the aging features in the time series data.
[0012] The pre-trained prediction model constructs a fitness function during training with the common goals of minimizing prediction error and minimizing feature redundancy to optimize hyperparameters and aging trend characteristics of proton exchange membrane fuel cells. It also selects aging trend characteristics related to aging trend from time-series data of proton exchange membrane fuel cells based on an adaptive genetic operation operator strategy.
[0013] S20, obtain the voltage prediction result output by the pre-trained prediction model, and determine the remaining lifetime prediction value of the proton exchange membrane fuel cell under test based on the voltage prediction result.
[0014] Optionally, the expression for the variable-scale one-dimensional convolution kernel function is:
[0015]
[0016] In the formula, Indicates the time step of the convolutional layer Linear pre-activated output; Indicates time series data at time points The value; For the convolution kernel in the th Weight parameters for each position; It is a bias term; The size of the variable-scale convolution kernel is positively correlated with the degree of local fluctuation in time-series data. This represents the final output after the ReLU function is activated, and is used to characterize the activation intensity of the local aging features of a proton exchange membrane fuel cell.
[0017] The mathematical expression for the pooling downsampling is:
[0018]
[0019] In the formula, Indicates the pooling layer in the 1st... The output value of each time window; s is the adaptive pooling step size, which is positively correlated with the activation intensity of the convolution output feature; This refers to the time step value within the corresponding adaptive window in the ReLU output feature map.
[0020] Optionally, in the coding layer, an aging feature attention mask is used to mask the attention calculation process of redundant segments in the time-series data, and an aging feature capture is performed by assigning a number of attention heads that are positively correlated with the time scale to non-redundant segments. Specifically, this includes:
[0021] Let the multi-head self-attention output formula with aging feature attention mask be:
[0022]
[0023] Among them, a single attention head The mathematical expression is:
[0024]
[0025] In the formula, These are the query vector, key vector, and value vector, respectively; M is the aging feature attention mask, which assigns 0 to redundant segments in the time series data to mask their attention calculation, and assigns 1 to non-redundant segments to retain attention calculation;
[0026] In the formula, To focus on head count, a low head count captures aging dependence on short timescales, while a high head count captures aging dependence on long timescales. , , The first The query, key, and value weight matrix for each head; for The dimension; Input dimensions into the Transformer; is the output weight matrix of multi-head attention; ⊗ represents the element-wise multiplication operation.
[0027] Optionally, in the coding layer, the size of the weight matrix of the feedforward network is determined based on the activation intensity of the aging features in the time-series data, specifically including:
[0028] Set feature enhancement factor The weight coefficients of the weight matrix of the feedforward network are adjusted according to the activation intensity of the aging features in the time series data. The size of the feedforward network's weight matrix is adjusted accordingly.
[0029] The expression for the feedforward network is as follows:
[0030]
[0031] In the formula, , Here is the weight matrix of the FFN; , For bias terms; is the ReLU activation function, which performs nonlinear activation on the linear transformation result, setting negative values to 0 and keeping positive values unchanged. This introduces nonlinearity to fit the complex aging pattern of PEMFC and alleviates the gradient vanishing problem. X is the input feature of FFN, which comes from the output of the previous multi-head self-attention module and contains long-distance dependency features of PEMFC time series data.
[0032] Optionally, optimization is performed with the goal of maximizing the fitness function, wherein the fitness function... The expression is:
[0033]
[0034] In the formula, The prediction error loss function; The feature redundancy loss function; These are weighting coefficients used to balance prediction error and feature redundancy;
[0035] in:
[0036]
[0037]
[0038] In the formula, Individuals encoded as hyperparameters and feature subsets; This represents the number of samples in the test set. Predict the voltage value for individual x using the model; This is the actual voltage value; Features and Mutual information; F is the total number of features.
[0039] Optionally, the adaptive genetic operation operator strategy includes selection operators, adaptive crossover operators, and adaptive mutation operators;
[0040] The adaptive genetic operation operator strategy includes the following steps:
[0041] S11 uses a roulette wheel selection operator to filter the test set samples, ensuring that the probability of an individual being selected in the test set is positively correlated with its fitness:
[0042]
[0043] In the formula, For the first The probability of selecting a sample from the test set; Population size; For the first One test set sample;
[0044] S12, dynamically adjust the adaptive crossover operator based on individual fitness, using a small crossover coefficient to retain superior genes in high-fitness individuals and a large crossover coefficient to promote evolution in low-fitness individuals; wherein, the expression of the adaptive crossover operator is:
[0045]
[0046] In the formula, For adaptive crossover operators, These are the upper and lower limits of the cross coefficient, respectively. For individual fitness; These represent the maximum and minimum fitness of the current population, respectively. The average fitness of the current population;
[0047] S13, dynamically adjust the adaptive mutation operator based on individual fitness. The expression for the adaptive mutation operator is:
[0048]
[0049] In the formula, For adaptive mutation operators; These are the lower and upper limits of the mutation probability, respectively; For the disturbance variance; This represents the probability of mutation.
[0050] Optionally, before step S10, the method further includes:
[0051] S30, performs median filtering with noise detection on the acquired proton exchange membrane fuel cell data under test:
[0052]
[0053] In the formula, This represents the voltage after noise reduction at time t; The half-width of the adaptive filtering window is determined by the noise intensity. Sure; The data sampling interval; It is a median function;
[0054] S40, determine the voltage attenuation rate based on the change in voltage after noise reduction, determine the target sampling sliding window length based on the voltage attenuation rate, and perform data sampling based on the target sampling sliding window length:
[0055]
[0056] In the formula: For the first One input sample; The sliding window length is determined by the voltage decay rate. For the first The termination time for each sample;
[0057] S50, introduce an aging characteristic contribution constraint to screen aging trend characteristics from the proton exchange membrane fuel cell data to be tested. The expression for the aging characteristic contribution constraint is:
[0058]
[0059] In the formula, For the first The importance of each feature; For the first The predicted voltage for the first sample is... Partial derivatives of each feature; Contribution factor to aging characteristics.
[0060] Optionally, in step S20, determining the predicted remaining lifetime of the proton exchange membrane fuel cell under test based on the voltage prediction result includes:
[0061] S21, Based on the voltage prediction results, determine the prediction time when the predicted voltage first meets the multi-time window failure verification requirement. ;
[0062] S22, based on the predicted time , compared with the actual current monitoring time The difference between the two values is used to determine the remaining lifetime prediction value RUL:
[0063] .
[0064] In addition, to achieve the above objectives, this application also provides a computer system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in any of the preceding claims.
[0065] In addition, to achieve the above objectives, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in any of the preceding claims.
[0066] This application has at least the following beneficial effects:
[0067] 1. To address the issue of key local features being easily lost in proton exchange membrane fuel cells, a variable-scale convolution kernel is adaptively slid along the time dimension, followed by adaptive pooling downsampling, thereby capturing discriminative short-term aging time patterns.
[0068] 2. To address the large number of redundant stationary segments in the time-series data of proton exchange membrane fuel cells, an aging feature attention mask is introduced to shield the attention calculation of redundant stationary segments. At the same time, the head allocation strategy of multi-head self-attention is optimized to adapt to the aging dependence characteristics of proton exchange membrane fuel cells at different time scales.
[0069] 3. To address the issue that prediction models for proton exchange membrane fuel cells are prone to getting trapped in local optima during hyperparameter and feature set optimization, a fitness function is constructed with the common objectives of minimizing prediction error and feature redundancy to optimize hyperparameters and aging trend characteristics of proton exchange membrane fuel cells.
[0070] 4. To address the heterogeneous characteristics of multiple features in proton exchange membrane fuel cell (PEMFC) data, an adaptive genetic operation operator strategy is proposed to select aging trend features related to aging trends in the time series data of PEMFC, thereby achieving accurate prediction of the aging trend and remaining life of PEMFC. Attached Figure Description
[0071] Figure 1 This is a flowchart illustrating the method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell according to an embodiment of this application.
[0072] Figure 2 This is a schematic diagram of the framework for predicting the aging trend and remaining life of a proton exchange membrane fuel cell according to an embodiment of this application.
[0073] Figure 3 This is another flowchart illustrating the method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell according to an embodiment of this application.
[0074] Figure 4 This is a schematic diagram of the hardware operating environment of the computer system involved in the embodiments of this application.
[0075] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0076] To better understand the above technical solutions, exemplary embodiments of this disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of this disclosure to those skilled in the art.
[0077] First Embodiment
[0078] Reference Figures 1 to 3 This embodiment provides a method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell, the method comprising the following steps:
[0079] S10: Input the collected time-series data of the proton exchange membrane fuel cell under test into the pre-trained prediction model;
[0080] The pre-trained prediction model includes:
[0081] The feature extraction layer uses a variable-scale one-dimensional convolution kernel function to determine the adaptive sliding window corresponding to the time-varying features in the time-series data of the proton exchange membrane fuel cell, and then pools downsamples the local features of the time-series data within the adaptive sliding window.
[0082] In this embodiment, considering that the fixed convolutional kernels and pooling windows of traditional CNNs cannot adapt to the non-stationary, noisy, and time-varying characteristics of time-series data such as voltage and temperature of proton exchange membrane fuel cells (PEMFCs), direct application would lead to the loss of key local features during aging, and the pooling operation is prone to excessive compression of feature information. To address this defect, this embodiment improves the CNN feature extraction layer of the pre-trained prediction model: a variable-scale one-dimensional convolutional kernel is used to adapt to the time-varying characteristics of PEMFC time-series data, the max pooling window is optimized into an adaptive sliding window, and combined with the ReLU activation function, the local dependent features in the PEMFC time series are accurately captured. The core process is to use the variable-scale convolutional kernel to adaptively slide along the time dimension, introduce a nonlinear transformation through the ReLU function, and then downsample through adaptive pooling operations to capture discriminative short-term aging time patterns.
[0083] Specifically and optionally, for variable-scale one-dimensional convolutional kernel functions, this process first performs variable-scale linear convolution operations, and then applies the ReLU activation function. ReLU introduces non-linearity into the network by outputting zero for negative values and keeping positive values unchanged, enabling it to learn complex temporal aging patterns in PEMFC (such as sudden voltage fluctuations and slowly decaying waveforms). This "selective activation" characteristic makes the network sparser, helping to accelerate training and alleviate the gradient vanishing problem. Simultaneously, the variable-scale convolutional kernel can adjust its receptive field according to the local fluctuations in the temporal data, avoiding the feature capture blind spots of fixed convolutional kernels. The formula is as follows:
[0084]
[0085] In the formula, Indicates the time step of the convolutional layer Linear pre-activated output; Indicates time series data at time points The value; For the convolution kernel in the th Weight parameters for each position; It is a bias term; The size of the variable-scale convolution kernel is positively correlated with the degree of local fluctuation in time-series data. This represents the final output after the ReLU function is activated, and is used to characterize the activation intensity of the local aging features of a proton exchange membrane fuel cell.
[0086] On the other hand, to address the drawback of traditional fixed pooling windows over-compressing PEMFC feature information, this embodiment optimizes the pooling window into an adaptive sliding window. The window size is adjusted based on the activation intensity of the convolution output features. This reduces the temporal resolution of the feature maps, computational load, and number of parameters while maximizing the preservation of key PEMFC aging features, thus enhancing the model's robustness to minor temporal changes. The formula is as follows:
[0087]
[0088] In the formula: Indicates the pooling layer in the 1st... The output value of each time window; s is the adaptive pooling step size, which is dynamically adjusted according to the activation intensity of the convolution output features (values range from 2 to 4). This refers to the time step value within the corresponding adaptive window in the ReLU output feature map.
[0089] In the encoding layer, an aging feature attention mask is used to shield the attention calculation process of redundant segments in the time series data. The number of attention heads that are positively correlated with the time scale are assigned to non-redundant segments for aging feature capture. The size of the weight matrix of the feedforward network is determined according to the activation intensity of the aging features in the time series data.
[0090] In this embodiment, when the traditional Transformer self-attention mechanism is directly applied to long-term PEMFC data, it suffers from drawbacks such as computational redundancy, low efficiency in capturing long-distance dependencies, and unreasonable attention weight allocation. PEMFC runtime data contains a large number of redundant stable segments. Traditional self-attention performs equal-weight calculations on the entire sequence, resulting in wasted computational resources and insufficient accuracy in capturing critical long-distance dependencies related to aging. To address this challenge, this embodiment improves the Transformer encoding layer.
[0091] An aging feature attention mask is introduced to shield the attention calculation of redundant stable segments. At the same time, the head number allocation strategy of multi-head self-attention is optimized to adapt to the aging dependency features of PEMFC at different time scales. The loop or convolution structure is abandoned and the global correlation weight between key aging elements in the sequence is directly calculated, which improves the efficiency and accuracy of long-distance dependency capture while achieving parallel processing.
[0092] It should be noted that the redundant segments in the time-series data refer to continuous time intervals during the operation of a proton exchange membrane fuel cell where the time-series data such as voltage, current, and temperature remain stable over a long period, without significant decay or fluctuation, and are unrelated to aging trends. These can be determined using the following methods:
[0093] First, take the difference between the starting voltage and the ending voltage within the adaptive window and calculate the time difference:
[0094]
[0095]
[0096] In the formula, This is the window start time; This is the window termination time. Then, the voltage decay rate is calculated:
[0097]
[0098] The aging characteristic contribution threshold is calculated from the voltage decay rate:
[0099]
[0100] In the formula, The base threshold is the voltage decay rate. The threshold value at that time; This is the attenuation adjustment coefficient.
[0101] When the contribution of aging features is below the threshold, it is a redundant segment; when the contribution of aging features is above the threshold, it is a non-redundant segment.
[0102] Specifically, and optionally, let the multi-head self-attention output formula with an aging feature attention mask be:
[0103]
[0104] Among them, a single attention head The mathematical expression is:
[0105]
[0106] In the formula, These are the query vector, key vector, and value vector, respectively; M is the aging feature attention mask, which assigns 0 to redundant segments in the time series data to mask their attention calculation, and assigns 1 to non-redundant segments to retain attention calculation;
[0107] In the formula, To focus on head count, a low head count captures aging dependence on short timescales, while a high head count captures aging dependence on long timescales. , , The first The query, key, and value weight matrix for each head; for The dimension; Input dimensions into the Transformer; is the output weight matrix of multi-head attention; ⊗ represents the element-wise multiplication operation.
[0108] Furthermore, to enhance the nonlinear expression of aging features in PEMFC, a feature enhancement factor is introduced based on the traditional feedforward network FFN. This factor adjusts the nonlinear transformation weights according to the activation intensity of aging features, addressing the problem of insufficient expression of weak aging features by the traditional FFN. Specifically, this includes:
[0109] Set feature enhancement factor The weight coefficients of the weight matrix of the feedforward network are adjusted according to the activation intensity of the aging features in the time series data. The size of the feedforward network's weight matrix is adjusted accordingly.
[0110] The expression for the feedforward network is as follows:
[0111]
[0112] In the formula, , Here is the weight matrix of the FFN; , For bias terms; is the ReLU activation function, which performs nonlinear activation on the linear transformation result, setting negative values to 0 and keeping positive values unchanged. This introduces nonlinearity to fit the complex aging pattern of PEMFC and alleviates the gradient vanishing problem. X is the input feature of FFN, which comes from the output of the previous multi-head self-attention module and contains long-distance dependency features of PEMFC time series data.
[0113] It should be noted that the activation intensity of aging features in time series data refers to a quantitative indicator reflecting the degree of activation of aging features within the current time step or local time period after the time series data has passed through the feature extraction network. This can be determined using the aging feature contribution method.
[0114]
[0115] In the formula, The contribution of the k-th feature; The aging feature vector extracted from the model; Let be the i-th dimension of the aging feature component. The higher the contribution of the aging feature, the greater its contribution to the aging characterization, and the stronger its activation intensity.
[0116] The pre-trained prediction model constructs a fitness function during training with the common goals of minimizing prediction error and minimizing feature redundancy to optimize hyperparameters and aging trend characteristics of proton exchange membrane fuel cells. It also selects aging trend characteristics related to aging trend from time-series data of proton exchange membrane fuel cells based on an adaptive genetic operation operator strategy.
[0117] In this embodiment, considering the three major drawbacks of directly applying traditional genetic algorithms to optimize the hyperparameters and feature sets of the PEMFC prediction model: First, the fitness function is singular, only considering the prediction error and not the feature correlation of PEMFC data, which easily leads to redundancy in the optimized feature set; second, the crossover and mutation operators are fixed parameters, which cannot adapt to the heterogeneous characteristics of PEMFC hyperparameters (continuous) and feature sets (discrete), resulting in low optimization efficiency; and third, it is prone to getting trapped in local optima, resulting in insufficient convergence accuracy. To address these problems, this invention adaptively improves the genetic algorithm, constructing an adaptive genetic algorithm optimization model adapted to the PEMFC scenario, and globally optimizes the model's hyperparameters and input feature set.
[0118] To address the first drawback of the conversion, we abandon the traditional fitness function based solely on the root mean squared error (RMSE) and introduce a feature mutual information constraint. Simultaneously considering prediction error and feature redundancy, we resolve the feature set redundancy issue after optimization in traditional algorithms. Using the RMSE of PEMFC aging prediction and feature mutual information as dual objectives, we measure the performance of an individual (hyperparameter-feature combination), specifically including:
[0119] fitness function The fitness function aims to maximize the value of ∈(0,1], where a larger value indicates better individual performance; The expression is:
[0120]
[0121] In the formula, The prediction error loss function; The feature redundancy loss function; These are weighting coefficients used to balance prediction error and feature redundancy;
[0122] in:
[0123]
[0124]
[0125] In the formula, Individuals encoded as hyperparameters and feature subsets; This represents the number of samples in the test set. Predict the voltage value for individual x using the model; This is the actual voltage value; Features and Mutual information; F is the total number of features.
[0126] On the other hand, to address the second and third defects of the conversion, we propose an adaptive genetic operation operator strategy to adapt to the heterogeneity of PEMFC hyperparameters and feature sets. By dynamically adjusting the crossover and mutation parameters, we improve optimization efficiency and accuracy. Specifically, the adaptive genetic operation operator strategy includes selection operators, adaptive crossover operators, and adaptive mutation operators.
[0127] The adaptive genetic operation operator strategy includes the following steps:
[0128] S11 uses a roulette wheel selection operator to filter the test set samples, ensuring that the probability of an individual being selected in the test set is positively correlated with its fitness:
[0129]
[0130] In the formula, For the first The probability of selecting a sample from the test set; Population size; For the first One test set sample;
[0131] In some alternative implementations, step S11 further introduces an elite retention strategy, directly retaining the top 10% of individuals in fitness from each generation to the next generation to avoid losing excellent individuals.
[0132] To address the shortcomings of traditional fixed crossover coefficients, S12 proposes an adaptive crossover operator that dynamically adjusts based on individual fitness. This involves using a small crossover coefficient for high-fitness individuals to preserve superior genes, and a large crossover coefficient for low-fitness individuals to promote evolution. The expression for the adaptive crossover operator is as follows:
[0133]
[0134] In the formula, For adaptive crossover operators, These are the upper and lower limits of the cross coefficient, respectively. For individual fitness; These represent the maximum and minimum fitness of the current population, respectively. The average fitness of the current population;
[0135] For example, with learning rate For example, the arithmetic cross formula for hyperparameters is given:
[0136]
[0137] For example, taking feature encoding as an example, the single-point cross formula for feature subsets is given:
[0138]
[0139] In the formula, , The learning rate of the parent individuals; , The learning rate of offspring individuals; Intersection point (randomly selected) , (total characteristic number); , For the first generation of the parent individual Each feature is encoded.
[0140] To address the shortcomings of traditional fixed mutation probabilities, this method dynamically adjusts mutation probabilities based on individual fitness. Simultaneously, it employs constrained random perturbation of hyperparameters for mutation (avoiding hyperparameters exceeding their physical limits), and uses bit-flipping mutation for feature subsets. This solves the problem of traditional algorithms easily getting trapped in local optima.
[0141] Step S13: Dynamically adjust the adaptive mutation operator based on individual fitness. The expression for the adaptive mutation operator is:
[0142]
[0143] In the formula, For adaptive mutation operators; These are the lower and upper limits of the mutation probability, respectively; For the disturbance variance; This represents the probability of mutation.
[0144] In some alternative implementations, the perturbation variance The value should be between 0.1 and 0.5 to avoid excessive mutation; mutation probability. The value ranges from 0.01 to 0.05.
[0145] S20, obtain the voltage prediction result output by the pre-trained prediction model, and determine the remaining lifetime prediction value of the proton exchange membrane fuel cell under test based on the voltage prediction result.
[0146] In this embodiment, the pre-trained prediction model, after the above training and the above architecture settings, obtains its output voltage prediction result, and determines the remaining lifetime prediction value of the proton exchange membrane fuel cell under test based on the voltage prediction result.
[0147] Specifically and optionally, considering that when the traditional RUL calculation model is directly applied to PEMFC, there are defects such as a fixed failure threshold and susceptibility to misjudgment due to instantaneous fluctuations: the aging characteristics of PEMFC under steady-state and dynamic conditions are significantly different, the fixed failure threshold cannot be adapted to different operating conditions, and failure is determined only by a single voltage drop below the threshold, which is prone to misjudging instantaneous fluctuations as aging failure.
[0148] Therefore, this embodiment improves the RUL calculation model by introducing an adaptive failure threshold based on operating conditions and multi-time window failure verification, specifically including:
[0149] S21, Based on the voltage prediction results, determine the prediction time when the predicted voltage first meets the multi-time window failure verification requirement. ;
[0150] S22, based on the predicted time , compared with the actual current monitoring time The difference between the two values is used to determine the remaining lifetime prediction value RUL:
[0151]
[0152] In some alternative implementations, data such as remaining lifetime predictions and voltage prediction results are displayed in a visual format, combining formulas and charts, including but not limited to:
[0153] (1) Constraint based on aging characteristic contribution A feature importance heatmap is drawn to show the contribution of each feature to the prediction results, and the core aging features are marked.
[0154] (2) Voltage prediction curve comparison chart, used to show the model predicted voltage value Compared with actual voltage value The temporal changes between them;
[0155] (3) RUL trend chart, used to update RUL in real time with the current monitoring time. Changes, and marking the warning threshold (e.g.) (Timely maintenance reminders are triggered), and the aging level is marked based on the aging rate;
[0156] (4) GA optimization process diagram, used to illustrate the fitness function With the number of iterations The convergence curve.
[0157] In the technical solution provided in this embodiment, to address the phenomenon that key local features of proton exchange membrane fuel cells (PEMFCs) are easily lost, a variable-scale convolution kernel is adaptively slid along the time dimension, followed by adaptive pooling downsampling to capture discriminative short-term aging time patterns. To address the large number of redundant stationary segments in the time-series data of PEMFCs, an aging feature attention mask is introduced to shield the attention calculation of redundant stationary segments. Simultaneously, the head allocation strategy for multi-head self-attention is optimized to adapt to the aging dependency features of PEMFCs at different time scales. To address the defect that the prediction model of PEMFCs is prone to getting trapped in local optima during hyperparameter and feature set optimization, a fitness function is constructed with the common objectives of minimizing prediction error and feature redundancy to optimize hyperparameters and aging trend features of PEMFCs. To address the heterogeneous characteristics of multiple features in the PEMFC data, an adaptive genetic operation operator strategy is proposed to select aging trend features related to the aging trend in the time-series data of PEMFCs, thereby achieving accurate prediction of the aging trend and remaining life of PEMFCs.
[0158] Second Embodiment
[0159] Based on the first embodiment, this embodiment provides a preprocessing method for the collected proton exchange membrane fuel cell data to be tested, namely, before step S10, it further includes:
[0160] S30, performs median filtering with noise detection on the acquired proton exchange membrane fuel cell data under test:
[0161]
[0162] In the formula, This represents the voltage after noise reduction at time t; The half-width of the adaptive filtering window is determined by the noise intensity. Sure; The data sampling interval; It is a median function.
[0163] In some optional implementations, the data sampling interval The selection was based on experience with the aging data characteristics of PEMFC.
[0164] Furthermore, traditional fixed-length sliding window sampling cannot adapt to the time-varying characteristics of PEMFC aging features, easily leading to the loss of feature information during critical aging periods. To address this issue, an aging feature alignment mechanism is introduced. The sliding window length is adjusted according to the PEMFC voltage decay rate to achieve accurate alignment and sampling of aging features, namely:
[0165] S40, determine the voltage attenuation rate based on the change in voltage after noise reduction, determine the target sampling sliding window length based on the voltage attenuation rate, and perform data sampling based on the target sampling sliding window length:
[0166]
[0167] In the formula: For the first One input sample; The sliding window length is determined by the voltage decay rate. For the first The termination time for each sample;
[0168] Furthermore, based on the adaptive genetic operation operator proposed in the first embodiment, an aging feature contribution constraint is introduced to avoid selecting redundant features unrelated to aging, i.e.:
[0169] S50, introduce an aging characteristic contribution constraint to screen aging trend characteristics from the proton exchange membrane fuel cell data to be tested. The expression for the aging characteristic contribution constraint is:
[0170]
[0171] In the formula, For the first The importance of each feature; For the first The predicted voltage for the first sample is... Partial derivatives of each feature; Contribution factor to aging characteristics.
[0172] Third Embodiment
[0173] Based on any of the above embodiments, this embodiment provides an optimization method for the pre-trained prediction model in a proton exchange membrane fuel cell scenario, specifically including:
[0174] (1) Global optimization of adaptive genetic algorithm
[0175] (1.1) Multi-objective optimization objective function with model complexity constraints
[0176]
[0177] In the formula: , , These are the weighting coefficients; The number of model parameters (reflecting complexity); The maximum number of parameters is the threshold (the value is determined based on the actual situation of the PEMFC prediction scenario to avoid model overfitting); MI is the average mutual information of the feature set (characterizing feature redundancy).
[0178] (1.2) Constraints for adapting to PEMFC scenarios:
[0179] Hyperparameter range constraints:
[0180]
[0181] Feature subset constraints (retain at least 3 core PEMFC aging features):
[0182]
[0183] Population evolution constraints (number of iterations):
[0184]
[0185] (2) Improved CNN-Transformer prediction
[0186] (2.1) Model training objective function with aging feature constraints
[0187] Mean Squared Error (MSE) is used as the basic loss function. An aging feature regularization term is introduced to constrain the model's weights on aging-weakly correlated features, avoiding the model learning irrelevant noise and minimizing the deviation between the predicted and actual voltages. The formula is as follows:
[0188]
[0189] In the formula: The number of samples in the training set; The predicted voltage for the training samples; The regularization coefficient is used. The weights of the model for the k-th feature; The importance of characteristic aging; This is the actual voltage.
[0190] (2.2) Training constraints for adapting to PEMFC data
[0191] Gradient update constraints (to avoid gradient explosion):
[0192]
[0193] Training round constraints:
[0194]
[0195] Generalization capability constraints (RMSE on the test set):
[0196]
[0197] Refer to the voltage prediction accuracy requirements of PEMFC.
[0198] Furthermore, as an implementation scheme, Figure 4 This is a schematic diagram of the hardware operating environment of the computer system involved in the embodiments of this application.
[0199] like Figure 4 As shown, the computer system may include: a processor 1001, such as a CPU; a memory 1005; a user interface 1003; a network interface 1004; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0200] Those skilled in the art will understand that Figure 4 The computer system architecture shown does not constitute a limitation on the computer system and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0201] like Figure 4As shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, a user interface module, and computer programs. The operating system is a program that manages and controls the hardware and software resources of the computer system, as well as the operation of the computer programs and other software or programs.
[0202] exist Figure 4 In the computer system shown, the user interface 1003 is mainly used to connect to the terminal and communicate with the terminal; the network interface 1004 is mainly used to communicate with the backend server; and the processor 1001 can be used to call the computer program stored in the memory 1005.
[0203] In this embodiment, the computer system includes: a memory 1005, a processor 1001, and a computer program stored in the memory and executable on the processor, wherein:
[0204] When processor 1001 calls a computer program stored in memory 1005, it performs the following operations:
[0205] S10: Input the collected time-series data of the proton exchange membrane fuel cell under test into the pre-trained prediction model;
[0206] The pre-trained prediction model includes:
[0207] The feature extraction layer uses a variable-scale one-dimensional convolution kernel function to determine the adaptive sliding window corresponding to the time-varying features in the time-series data of the proton exchange membrane fuel cell, and then pools downsamples the local features of the time-series data within the adaptive sliding window.
[0208] In the encoding layer, an aging feature attention mask is used to shield the attention calculation process of redundant segments in the time series data. The number of attention heads that are positively correlated with the time scale are assigned to non-redundant segments for aging feature capture. The size of the weight matrix of the feedforward network is determined according to the activation intensity of the aging features in the time series data.
[0209] The pre-trained prediction model constructs a fitness function during training with the common goals of minimizing prediction error and minimizing feature redundancy to optimize hyperparameters and aging trend characteristics of proton exchange membrane fuel cells. It also selects aging trend characteristics related to aging trend from time-series data of proton exchange membrane fuel cells based on an adaptive genetic operation operator strategy.
[0210] S20, obtain the voltage prediction result output by the pre-trained prediction model, and determine the remaining lifetime prediction value of the proton exchange membrane fuel cell under test based on the voltage prediction result.
[0211] Furthermore, those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in a computer system to implement the process steps of the embodiments of the above methods.
[0212] Therefore, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the various steps of the method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in the above embodiments.
[0213] The computer-readable storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0214] It should be noted that, since the storage medium provided in the embodiments of this application is the storage medium used to implement the methods of the embodiments of this application, those skilled in the art can understand the specific structure and variations of the storage medium based on the methods described in the embodiments of this application, and therefore will not be repeated here. All storage media used in the methods of the embodiments of this application fall within the scope of protection of this application.
[0215] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0216] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0217] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0218] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0219] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0220] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell, characterized in that, The method includes the following steps: S10: Input the collected time-series data of the proton exchange membrane fuel cell under test into the pre-trained prediction model; The pre-trained prediction model includes: The feature extraction layer uses a variable-scale one-dimensional convolution kernel function to determine the adaptive sliding window corresponding to the time-varying features in the time-series data of the proton exchange membrane fuel cell, and then pools downsamples the local features of the time-series data within the adaptive sliding window. In the encoding layer, an aging feature attention mask is used to shield the attention calculation process of redundant segments in the time series data. The number of attention heads that are positively correlated with the time scale are assigned to non-redundant segments for aging feature capture. The size of the weight matrix of the feedforward network is determined according to the activation intensity of the aging features in the time series data. The pre-trained prediction model constructs a fitness function during training with the common goals of minimizing prediction error and minimizing feature redundancy to optimize hyperparameters and aging trend characteristics of proton exchange membrane fuel cells. It also selects aging trend characteristics related to aging trend from time-series data of proton exchange membrane fuel cells based on an adaptive genetic operation operator strategy. S20, obtain the voltage prediction result output by the pre-trained prediction model, and determine the remaining lifetime prediction value of the proton exchange membrane fuel cell under test based on the voltage prediction result.
2. The method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in claim 1, characterized in that, The expression for the variable-scale one-dimensional convolution kernel function is: ; In the formula, Indicates the time step of the convolutional layer Linear pre-activated output; Indicates time series data at time points The value; For the convolution kernel in the th Weight parameters for each position; It is a bias term; The size of the variable-scale convolution kernel is positively correlated with the degree of local fluctuation in time-series data. This represents the final output after the ReLU function is activated, and is used to characterize the activation intensity of the local aging features of a proton exchange membrane fuel cell. The mathematical expression for the pooling downsampling is: ; In the formula, Indicates the pooling layer in the 1st... Output values for each time window; s is the adaptive pooling step size, which is positively correlated with the activation intensity of the convolution output features; This refers to the time step value within the corresponding adaptive window in the ReLU output feature map.
3. The method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in claim 1, characterized in that, In the encoding layer, an aging feature attention mask is used to mask the attention calculation process of redundant segments in the time-series data. An attention head number positively correlated with the time scale is assigned to non-redundant segments for aging feature capture. Specifically, this includes: Let the multi-head self-attention output formula with aging feature attention mask be: ; Among them, a single attention head The mathematical expression is: ; In the formula, These are the query vector, key vector, and value vector, respectively; M is the aging feature attention mask, which assigns 0 to redundant segments in the time series data to mask their attention calculation, and assigns 1 to non-redundant segments to retain attention calculation; In the formula, To focus on head count, a low head count captures aging dependence on short timescales, while a high head count captures aging dependence on long timescales. , , The first The query, key, and value weight matrix for each head; for The dimension; Input dimensions into the Transformer; is the output weight matrix of multi-head attention; ⊗ represents the element-wise multiplication operation.
4. The method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in claim 1, characterized in that, In the encoding layer, the size of the weight matrix of the feedforward network is determined based on the activation intensity of the aging features in the time-series data, specifically including: Set feature enhancement factor The weight coefficients of the weight matrix of the feedforward network are adjusted according to the activation intensity of the aging features in the time series data. The size of the feedforward network's weight matrix is adjusted accordingly. The expression for the feedforward network is as follows: ; In the formula, , Let be the weight matrix of FFN; , For bias terms; is the ReLU activation function, which performs nonlinear activation on the linear transformation result, setting negative values to 0 and keeping positive values unchanged. This introduces nonlinearity to fit the complex aging pattern of PEMFC and alleviates the gradient vanishing problem. X is the input feature of FFN, which comes from the output of the previous multi-head self-attention module and contains long-distance dependency features of PEMFC time series data.
5. The method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in claim 1, characterized in that, The optimization is performed with the goal of maximizing the fitness function, wherein the fitness function... The expression is: ; In the formula, The prediction error loss function; The feature redundancy loss function; These are weighting coefficients used to balance prediction error and feature redundancy; in: ; ; In the formula, Individuals encoded as hyperparameters and feature subsets; This represents the number of samples in the test set. Predict the voltage value for individual x using the model; This is the actual voltage value; Features and Mutual information; F is the total number of features.
6. The method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in claim 1, characterized in that, The adaptive genetic operation operator strategy includes selection operator, adaptive crossover operator, and adaptive mutation operator; The adaptive genetic operation operator strategy includes the following steps: S11 uses a roulette wheel selection operator to filter the test set samples, ensuring that the probability of an individual being selected in the test set is positively correlated with its fitness: ; In the formula, For the first The probability of selecting a sample from the test set; Population size; For the first One test set sample; S12, dynamically adjust the adaptive crossover operator based on individual fitness, using a small crossover coefficient to retain superior genes in high-fitness individuals and a large crossover coefficient to promote evolution in low-fitness individuals; wherein, the expression of the adaptive crossover operator is: ; In the formula, For adaptive crossover operators, These are the upper and lower limits of the cross coefficient, respectively. For individual fitness; These represent the maximum and minimum fitness of the current population, respectively. The average fitness of the current population; S13, dynamically adjust the adaptive mutation operator based on individual fitness. The expression for the adaptive mutation operator is: ; In the formula, For adaptive mutation operators; These are the lower and upper limits of the mutation probability, respectively; For the disturbance variance; This represents the probability of mutation.
7. The method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in claim 1, characterized in that, Before step S10, the method further includes: S30, performs median filtering with noise detection on the acquired proton exchange membrane fuel cell data under test: ; In the formula, This represents the voltage after noise reduction at time t; The half-width of the adaptive filtering window is determined by the noise intensity. Sure; The data sampling interval; It is a median function; S40, determine the voltage attenuation rate based on the change in voltage after noise reduction, determine the target sampling sliding window length based on the voltage attenuation rate, and perform data sampling based on the target sampling sliding window length: ; In the formula: For the first One input sample; The sliding window length is determined by the voltage decay rate. For the first The termination time for each sample; S50, introduce an aging characteristic contribution constraint to screen aging trend characteristics from the proton exchange membrane fuel cell data to be tested. The expression for the aging characteristic contribution constraint is: ; In the formula, For the first The importance of each feature; For the first The predicted voltage of the first sample is... Partial derivatives of each feature; Contribution factor to aging characteristics.
8. The method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in claim 1, characterized in that, In step S20, determining the predicted remaining lifetime of the proton exchange membrane fuel cell under test based on the voltage prediction result includes: S21, Based on the voltage prediction results, determine the prediction time when the predicted voltage first meets the multi-time window failure verification requirement. ; S22, based on the predicted time , compared with the actual current monitoring time The difference between the two values is used to determine the remaining lifetime prediction value RUL: 。 9. A computer system, characterized in that, The computer system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for predicting the aging trend and remaining life of a proton exchange membrane fuel cell as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method and system for predicting service life degradation of energy storage lithium battery
CN119104915A
Proton exchange membrane fuel cell life prediction method based on deep learning
CN119577355A
PEMFC life prediction method based on G-WD and optimized TCN-Transformer model
CN120742106A
Multi-head self-attention target tracking method based on Mama
CN121582295A
Battery SOC online simulation method and device, electronic equipment and storage medium
CN121679365A