Fuel cell performance and life prediction method based on neural network
Through the fuel cell performance and life prediction method based on neural network, the input features are extracted using the Pearson correlation coefficient and the model parameters are optimized, which solves the problem of inaccurate fuel cell performance prediction in the prior art, and achieves higher prediction accuracy and model convergence speed.
Patent Information
- Application Number
- CN202411995333.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
The existing fuel cell performance prediction methods have shortcomings in accurately predicting fuel cell performance, resulting in the inability to detect potential performance problems in time, the life prediction accuracy is low, the model convergence speed is slow, and the prediction accuracy is poor.
The fuel cell performance and life prediction method based on neural network is adopted. By acquiring fuel cell data, the input features are extracted based on Pearson's correlation coefficient, the features are input into the neural network model, and the model parameters are optimized using evaluation indicators to construct a fuel cell performance and life prediction model.
It improves the prediction accuracy of fuel cell life, enhances the trend prediction capability of the model, optimizes the input data, ensures that the correlation relationship between input and output is closer, and improves the prediction accuracy.
Smart Images

Figure CN119916245A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fuel cells, and in particular to a method for predicting fuel cell performance and life based on a neural network. Background Art
[0002] As a highly efficient and environmentally friendly new energy device, fuel cells have received widespread attention.
[0003] The performance prediction of fuel cells mainly includes predicting their performance parameters and lifespan. Prediction methods and technologies involve a variety of means, including real-time operation data, machine learning models, polarization curve tests, and electrochemical active area tests. Fuel cell performance prediction models are usually built based on historical operation data and historical voltage data through machine learning algorithms.
[0004] However, since fuel cell performance is affected by many factors, predicting its performance has become a complex and important task. Existing methods are insufficient in accurately predicting fuel cell performance, resulting in the inability to timely discover potential performance problems of fuel cells during application. When using fuel cell performance prediction models, existing technologies cannot verify and adjust the data of fuel cell performance prediction models through perfect evaluation indicators, resulting in low fuel cell life prediction accuracy. At the same time, the input data selected during prediction is redundant and contains a large amount of irrelevant data, which also leads to slow model convergence and poor prediction accuracy. Summary of the invention
[0005] The purpose of the present invention is to provide a method for predicting fuel cell performance and life based on a neural network in order to improve the accuracy of fuel cell life prediction.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] A method for predicting fuel cell performance and life based on a neural network, the method comprising the following steps:
[0008] acquiring fuel cell data, and extracting input features from the fuel cell data based on a Pearson correlation coefficient;
[0009] The input features are used as the input of the neural network model, the predicted value output by the neural network model is evaluated using evaluation indicators, and the parameters of the neural network model are optimized based on the evaluation results to obtain a fuel cell performance and life prediction model;
[0010] The fuel cell performance and life prediction model obtains actual fuel cell parameters and outputs actual prediction results.
[0011] Furthermore, the evaluation indicators are:
[0012] g combine=w1*MARE+w2*MAE
[0013] Among them, MARE is the maximum relative error, MAE is the mean absolute percentage error, w1 and w2 are the weights of the maximum relative error and the mean absolute percentage error.
[0014] Furthermore, the maximum relative error is:
[0015]
[0016] Where MARE represents the maximum relative error, represents the predicted voltage, and v represents the actual voltage.
[0017] Furthermore, the mean absolute percentage error is:
[0018]
[0019] Among them, MAE represents the mean relative error, represents the predicted voltage, and v represents the actual voltage.
[0020] Furthermore, the neural network model includes an input layer, an LSTM neural network layer, a first activation layer, a fully connected layer, a second activation layer and an output layer.
[0021] Furthermore, the activation layer adopts a linear rectifier unit as the activation function.
[0022] Furthermore, the Adam optimizer is used in the process of optimizing the parameters of the neural network model.
[0023] Furthermore, the specific steps of extracting input features from fuel cell data based on the Pearson correlation coefficient are as follows:
[0024] The fuel cell data is preprocessed, and the Pearson correlation coefficient between each feature input parameter corresponding to the preprocessed data and the output parameter is calculated. The feature input parameters are arranged based on the Pearson correlation coefficient, and the first n feature input parameters with the largest Pearson correlation coefficient are used as input features.
[0025] Furthermore, the Pearson correlation coefficient is:
[0026]
[0027] Among them, X i , Y i Represents the value of the characteristic input parameter X and output parameter Y of the i-th sample, They represent the mean of the feature input parameter X and the output parameter Y respectively.
[0028] Further, the output parameter is the fuel cell voltage.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] The present invention combines the maximum relative error, the average relative error, and the correlation coefficient as evaluation indicators, balances the sensitivity of the model to various errors, strengthens the trend prediction ability of the model, and improves the prediction accuracy. At the same time, the learning rate is dynamically adjusted in combination with the change of the loss function to ensure that the model converges quickly in the early stage of training and converges stably in the later stage. The present invention uses the Pearson correlation coefficient to measure and screen the input data of the prediction model, selects multiple features with the highest correlation, optimizes the input data, ensures that the correlation between the prediction performance of the input and output is closer, and improves the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a flow chart of the present invention;
[0032] Figure 2 It is a neural network structure diagram;
[0033] Figure 3 Construct a flow chart for the network model;
[0034] Figure 4 This is the prediction result of 0.3A / CM^2 attenuation curve of a fuel cell stack;
[0035] Figure 5 Predict the relative error of the 0.3A / CM^2 attenuation curve for a fuel cell stack;
[0036] Figure 6 This is the prediction result of the 0.5A / CM^2 attenuation curve of a fuel cell stack;
[0037] Figure 7 Predict the relative error of the 0.5A / CM^2 attenuation curve for a fuel cell stack;
[0038] Figure 8 This is the prediction result of the 0.7A / CM^2 attenuation curve of a fuel cell stack;
[0039] Fig. 9 The relative error of the predicted attenuation curve of a fuel cell stack at 0.7A / CM^2. DETAILED DESCRIPTION
[0040] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0041] The present invention proposes a method for predicting fuel cell performance and life based on a neural network, which can effectively predict the performance and life of a fuel cell, optimize the use effect of the fuel cell, reduce bench test time, and reduce test costs. Figure 1 The method comprises the following steps:
[0042] acquiring fuel cell data, and extracting input features from the fuel cell data based on a Pearson correlation coefficient;
[0043] The input features are used as the input of the neural network model, the predicted value output by the neural network model is evaluated using evaluation indicators, and the parameters of the neural network model are optimized based on the evaluation results to obtain a fuel cell performance and life prediction model;
[0044] The fuel cell performance and life prediction model obtains actual fuel cell parameters and outputs actual prediction results.
[0045] After obtaining the fuel cell data, preprocessing is performed, including the following steps:
[0046] ⅠData Collection:
[0047] Collect fuel cell operation data under different conditions from the laboratory or industrial production. Input parameters include temperature, pressure, current, humidity and gas flow rate, and the output parameter is the voltage of the fuel cell stack.
[0048] Ⅱ Data cleaning:
[0049] Remove missing data and noisy data, fill in blank data, and ensure data integrity.
[0050] ⅢData standardization:
[0051] Each parameter is normalized to eliminate the dimensional differences between dimensions and improve the comparability of the data.
[0052] When performing feature selection, we need to measure the correlation between each feature and the fuel cell performance target. A common method is to calculate the Pearson Correlation Coefficient between each feature and the target variable. It is a method to measure the linear correlation between two variables, and the value range is [-1,1]. Among them, 1 represents a perfect positive correlation, -1 represents a perfect negative correlation, and 0 represents no correlation.
[0053] Given two variables X and Y, the formula for calculating the Pearson correlation coefficient r is:
[0054]
[0055] in:
[0056] X i ,Y i Represents the eigenvalue of the i-th sample.
[0057] They represent the means of features X and Y respectively.
[0058] ∑ represents the summation symbol, which means summing all observations.
[0059] When r is close to 1 or -1, it indicates that there is a strong linear relationship between X and Y.
[0060] When r is close to 0, it means that the linear relationship between X and Y is weak or even non-existent.
[0061] Assume that the fuel cell data obtained in the first step has five characteristic input parameters: parameters A, B, C, D and E. The Pearson correlation coefficient between each parameter and the output parameter - fuel cell voltage is calculated as shown in Table 1:
[0062] Table 1 Pearson correlation coefficient of each parameter and fuel cell voltage
[0063] Parameter name A B C D E Correlation coefficient 0.9 0.85 -0.4 0.5 0.2
[0064] After calculating the correlation coefficient value, multiple features with the highest correlation are selected according to their absolute values. The present invention selects half of the original features and rounds down as new neural network input features. For example, there are five original feature parameters in the above table, and the new input feature parameters are the two parameters with the highest correlation coefficient, namely parameter A and parameter B. By using these two parameters as the initial input of the neural network prediction model, we further optimize the input data to ensure that the correlation between input and output is closer.
[0065] In order to predict the performance and life of fuel cells, we designed and built a deep neural network model. The specific steps are as follows:
[0066] Determine the network structure:
[0067] Input layer: The number of nodes is set according to the result of the feature selection part.
[0068] Hidden layer: The present invention uses two hidden layers, and the number of neurons is set to 64 and 32 respectively. Each layer uses a linear rectifier unit (ReLU) as an activation function. The first layer uses an LSTM neural network, and the second layer is a fully connected layer.
[0069] Output layer: Since the output is the fuel cell voltage, which is one-dimensional data, the number of nodes in this layer is set to 1.
[0070] The structure diagram of the network is shown in Figure 2.
[0071] In order to achieve better training effect of the model, the present invention adopts Adam optimizer to update the weight of the network. And adopts regularization method, adds L2 regularization term in the loss function, and suppresses the overfitting phenomenon that may occur in the network training process.
[0072] When training the model, data allocation: the data set is divided into a training set and a validation set, 70% for training, 15% for validation, and 15% for testing. Training parameters: Batch size is set to 32, and training epochs is set to 100.
[0073] First, use the validation data set to evaluate the model through evaluation indicators to check its generalization ability. Then adjust the network structure and hyperparameters (such as learning rate, number of hidden layers, number of neurons, etc.) according to the validation results. After the network structure is determined through the validation results, the performance of the model in the test set and the predicted attenuation trend at future moments are judged according to the voltage attenuation curve and combined with the evaluation indicators to evaluate the comprehensive performance.
[0074] For the neural network prediction model, it is not enough to only consider the error proximity of the data points, but also the overall prediction effect should be considered. Therefore, the present invention also introduces several other indicators to more comprehensively evaluate the prediction model.
[0075] The maximum relative error refers to the maximum absolute value of the deviation between the predicted data and the actual data, which can reflect the lower limit of the fit between the estimated value and the actual data. For the fuel cell stack prediction model, the lower limit of the deviation of the prediction curve can reflect the performance of the network model to a certain extent. Its calculation method is shown in formula (2):
[0076]
[0077] Where MARE represents the maximum relative error, represents the predicted voltage, and v represents the actual voltage.
[0078] The average relative error can describe the overall error level between the predicted curve and the true curve. Different from the relative error, it describes the accuracy scale of the prediction result from the data sequence level. Its calculation method is shown in formula (3):
[0079]
[0080] In the formula, MAE represents the mean relative error, represents the predicted voltage, and v represents the actual voltage.
[0081] The correlation coefficient is used to measure the linear correlation between variables. It is a statistical indicator that can describe the closeness of the correlation between predicted data and real data. The calculation formula of the correlation coefficient is shown in (4):
[0082]
[0083] Where X is the actual data sequence, Y is the predicted data sequence, Cov(X, Y) represents the covariance of the actual data and the predicted data, Var(X) and Var(Y) represent the variance of the actual data and the predicted data, respectively, and r(X, Y) is the correlation coefficient between the two.
[0084] For the maximum absolute error (MARE) and mean absolute percentage error (MAE), they can be normalized by dividing them by 100 to ensure that their values are between 0 and 1.
[0085] For the correlation coefficient r, since its value range is between -1 and 1, it can be normalized by adding 1 and then dividing by 2 so that its value range is mapped to between 0 and 1.
[0086] After standardization, the present invention sets a unified evaluation index g for the maximum relative error and the mean absolute percentage error. combine :
[0087] g combine =w1*MaxAE+w2*MAE (5)
[0088] When verifying the model, the present invention will use the above comprehensive indicators to screen out the fuel cell stack prediction results that meet the actual attenuation conditions, greatly enhancing the accuracy of the model prediction.
[0089] The network model construction flow chart is as follows Figure 2 shown.
[0090] The innovation of the present invention is:
[0091] Adaptive learning rate mechanism:
[0092] The learning rate is dynamically adjusted according to the changes in the loss function to ensure that the model converges quickly in the early stage of training and converges stably in the later stage.
[0093] Mixed loss function:
[0094] An innovative evaluation indicator combining the maximum relative error, average relative error and correlation coefficient is proposed to balance the model's sensitivity to various errors, enhance the model's trend prediction capability and improve prediction accuracy.
[0095] Automatically optimize the model:
[0096] A feedback optimization mechanism is added to the model. The model can automatically optimize the most suitable hyperparameters based on the results on the validation set, thus enhancing the universality of the model.
[0097] In actual application, input: operating parameter information of a fuel cell stack. Output: future voltage attenuation and attenuation trend of the fuel cell stack.
[0098] For a fuel cell stack, the model predicts the following output at different current densities: Figure 4-Figure 9 As shown. Figure 4 , Figure 6 , Figure 8 is the decay curve of the fuel cell. The red line segment is the original input, and the blue line segment is the model output result. Figure 5 , Figure 7 , Fig. 9 is the model error curve.
[0099] The advantages of the present invention are:
[0100] 1. High prediction accuracy:
[0101] Using neural network models, the performance of fuel cells can be predicted more accurately, errors can be reduced, and the reliability of predictions can be improved.
[0102] 2. Strong adaptability:
[0103] Through the optimization of hyperparameters, the model can adapt to fuel cells of different types and conditions and has strong generalization ability.
[0104] 3. Optimization and adjustment:
[0105] This prediction model can provide optimization suggestions for the design and operation of fuel cells and give the future attenuation trend of fuel cells.
[0106] 4. Automated processing:
[0107] This model can automate the prediction process through neural networks, reducing labor costs and subjective errors.
[0108] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for predicting fuel cell performance and life based on neural network, characterized in that: The method comprises the following steps: acquiring fuel cell data, and extracting input features from the fuel cell data based on a Pearson correlation coefficient; The input features are used as the input of the neural network model, the predicted value output by the neural network model is evaluated using evaluation indicators, and the parameters of the neural network model are optimized based on the evaluation results to obtain a fuel cell performance and life prediction model; The fuel cell performance and life prediction model obtains actual fuel cell parameters and outputs actual prediction results.
2. A method for predicting fuel cell performance and life based on a neural network according to claim 1, characterized in that: The evaluation indicators are: g combine =w1*SEA+w2*MAE Among them, MARE is the maximum relative error, MAE is the mean absolute percentage error, w1 and w2 are the weights of the maximum relative error and the mean absolute percentage error.
3. A method for predicting fuel cell performance and life based on a neural network according to claim 2, characterized in that: The maximum relative error is: Where MARE represents the maximum relative error, represents the predicted voltage, and v represents the actual voltage.
4. A method for predicting fuel cell performance and life based on a neural network according to claim 3, characterized in that: The mean absolute percentage error is: Among them, MAE represents the mean relative error, represents the predicted voltage, and v represents the actual voltage.
5. The method for predicting fuel cell performance and life based on a neural network according to claim 1, characterized in that: The neural network model includes an input layer, an LSTM neural network layer, a first activation layer, a fully connected layer, a second activation layer and an output layer.
6. A method for predicting fuel cell performance and life based on a neural network according to claim 5, characterized in that: The activation layer uses a linear rectifier unit as the activation function.
7. The method for predicting fuel cell performance and life based on a neural network according to claim 1, characterized in that: The Adam optimizer is used in the process of optimizing the parameters of the neural network model.
8. The method for predicting fuel cell performance and life based on a neural network according to claim 1, characterized in that: The specific steps to extract input features from fuel cell data based on the Pearson correlation coefficient are: The fuel cell data is preprocessed, and the Pearson correlation coefficient between each feature input parameter corresponding to the preprocessed data and the output parameter is calculated. The feature input parameters are arranged based on the Pearson correlation coefficient, and the first n feature input parameters with the largest Pearson correlation coefficient are used as input features.
9. A method for predicting fuel cell performance and life based on a neural network according to claim 8, characterized in that: The Pearson correlation coefficient is: Among them, X i ,Y i Represents the value of the characteristic input parameter X and output parameter Y of the i-th sample, They represent the mean of the feature input parameter X and the output parameter Y respectively.
10. A method for predicting fuel cell performance and life based on a neural network according to claim 9, characterized in that: The output parameter is the fuel cell voltage.
Citation Information
Cited By
Charging station planning method and system based on renewable energy sources
CN120509704A
Component prediction method after molten iron pretreatment based on adaptive multi-output BP neural network
CN121237263A