PEMFC voltage decline prediction-oriented frequency-time cooperative enhancement Transform model and prediction method
By enhancing the Transformer model through frequency-time collaboration and combining frequency and time domain information, the problems of insufficient local feature perception and frequency domain information utilization in PEMFC voltage decay prediction are solved. This enables accurate prediction of PEMFC voltage decay and multi-scale feature modeling, improving prediction accuracy and generalization ability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI UNIV OF TECH
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-08
AI Technical Summary
Existing Transformer models have weak local dynamic feature perception capabilities and insufficient utilization of frequency domain information in PEMFC voltage decay prediction, resulting in insufficient prediction accuracy and generalization ability.
A frequency-time co-enhanced Transformer model is adopted, which combines frequency domain and time domain information to achieve co-modeling of global and local features through a frequency domain feature extraction module, a time domain representation learning module, a time-frequency fusion module, and an enhanced encoder module.
It significantly improves the accuracy and cross-condition generalization capability of PEMFC voltage decay prediction, and can accurately capture long-term decay trends and local transient characteristics, adapting to complex and ever-changing operating conditions.
Smart Images

Figure CN121997293A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of fuel cell health management and artificial intelligence prediction technology, specifically to a frequency-time co-enhanced Transformer model and prediction method for PEMFC voltage degradation prediction. Background Technology
[0002] Proton exchange membrane fuel cells (PEMFCs), as a core representative of next-generation clean energy technology, have shown broad application prospects in various fields such as new energy vehicles, portable power supplies, and stationary power stations due to their outstanding advantages such as high energy density, zero emissions, and rapid start-up. However, during long-term operation, PEMFCs are affected by a combination of factors, including complex internal electrochemical reactions, aging and loss of core materials, and fluctuations in external dynamic load conditions, leading to irreversible degradation of their core performance indicator, output voltage. This voltage degradation directly restricts the service life and operational reliability of PEMFCs, becoming a key bottleneck hindering their large-scale commercialization.
[0003] Therefore, accurately predicting the voltage degradation trend of PEMFC is a core component of building its predictive maintenance and health management (PHM) system. It is of great significance for early warning of sudden failures, formulating scientific and reasonable predictive maintenance strategies, and reducing the total life cycle cost of equipment.
[0004] In the current technological development process, the prediction methods for PEMFC voltage degradation and remaining useful life (RUL) have mainly evolved into two major technical paths: Firstly, the model-driven approach. This approach attempts to characterize the aging mechanisms within fuel cells by establishing precise physicochemical mathematical models, such as catalyst active area decay, proton exchange membrane perforation, and electrode flooding. While this method has advantages in mechanistic explanation and can achieve certain predictive results under ideal, stable operating conditions, it has inherent limitations: PEMFCs are highly coupled, nonlinear, and complex systems involving electrical, thermal, and mass transfer. In real-world, complex, and variable operating environments, it is difficult to establish a universally applicable and accurate physical model. More importantly, the calibration process for model parameters heavily relies on expensive and time-consuming experimental data, resulting in poor engineering adaptability and economic efficiency, making it difficult to meet practical application needs.
[0005] Secondly, the data-driven approach. With the rapid development of sensing technology and computing power, this approach infers future performance trends by analyzing historical monitoring data accumulated during equipment operation. Because it does not rely on complex prior physical knowledge, it has gained widespread attention and has become the mainstream technology in this field. Its technological development can be further divided into several stages: In the early stages, traditional statistical learning methods such as Gaussian process regression and support vector machines were commonly used. These methods are effective in handling small samples and low-dimensional data, but when faced with high-frequency, multi-dimensional, and massive monitoring data generated in industrial sites, their model expressive power and generalization ability are insufficient, and the prediction accuracy is difficult to guarantee. During the rise of deep learning, recurrent neural networks (RNNs) and their variants, such as long short-term memory networks (LSTMs), became the mainstream models in the field due to their ability to model time-series dependencies. However, RNN models, due to their recursive computational structure based on sequence dependencies, suffer from inherent problems such as low training efficiency and vanishing gradients, making it difficult for them to effectively capture long-term decay trends spanning hundreds or even thousands of hours, and resulting in predictions that are often lagging or biased. Subsequently, convolutional neural networks (CNNs) were introduced to capture local features, but their receptive field is limited by the size of the convolutional kernel, resulting in a natural deficiency in global trend modeling and an inability to take into account both long-range dependencies and local details. At present, the Transformer model, due to its self-attention mechanism, can process sequences in parallel and establish direct long-range dependencies, showing great potential in time series prediction tasks and gradually becoming a research hotspot.
[0006] However, directly applying the standard Transformer architecture to PEMFC voltage sequence prediction still faces two core technical bottlenecks that urgently need to be addressed: Weak perception of local dynamic features: The self-attention mechanism is essentially a global, content-similarity-based weighted aggregation method. It lacks inductive bias towards local contextual structures, making the model insensitive to local transient patterns such as instantaneous voltage fluctuations and sharp drops caused by factors such as load abrupt changes, flooding, and catalyst failure. These local details are often important early warning signs of equipment failures, and their loss directly affects the timeliness and accuracy of fault warnings. Insufficient utilization of frequency domain information: The voltage degradation process of PEMFC not only manifests as a monotonically decreasing trend in the time domain, but also contains periodic fluctuations and harmonic characteristics related to operating conditions and control cycles. These frequency domain characteristics conceal rich global degradation patterns, but the standard Transformer model operates entirely in the time domain, making it impossible to explicitly decouple and utilize this frequency domain information, thus limiting the model's ability to comprehensively perceive and analyze multi-scale degradation characteristics.
[0007] Therefore, there is an urgent need in this field for an innovative technical solution that can effectively compensate for the shortcomings of Transformer in local feature perception and frequency domain information utilization while inheriting its advantages in long-range modeling. This would enable the coordinated and accurate modeling of global trends and local details throughout the entire decay process, thereby improving the accuracy, generalization and timeliness of PEMFC voltage decay prediction. Summary of the Invention
[0008] This invention aims to provide a frequency-time co-enhanced Transformer model and prediction method for PEMFC voltage decay prediction, which solves the technical problems of insufficient long-range trend modeling, weak perception of local dynamic features, and insufficient utilization of frequency domain information in existing models. It achieves co-accurate modeling of global decay trend and local transient features, significantly improving the accuracy, cross-condition generalization ability and engineering practicality of fuel cell voltage decay prediction.
[0009] To achieve the above objectives, the technical solution of the present invention is implemented as follows: A frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction is characterized by comprising a data preprocessing module, a frequency domain feature extraction module, a time domain representation learning module, a time-frequency fusion module, an enhanced encoder module, and a decoder module, with each module connected sequentially via a data stream to work collaboratively. The data preprocessing module is used to perform feature screening, data resampling, signal filtering and standardization on the raw fuel cell monitoring data, and output the normalized input data. The frequency domain feature extraction module is used to perform frequency domain transformation and feature extraction on the input data. It converts the time domain sequence into a frequency domain representation through the extended Fourier transform unit, models the correlation between frequencies through a complex self-attention mechanism, and then outputs a frequency domain representation rich in global periodicity and trend information through the frequency domain reconstruction unit. The time-domain representation learning module is used to perform embedding processing and position encoding on the input data and output a basic time-domain representation; The time-frequency fusion module is used to combine the frequency domain representation with the basic time domain representation through channel-dimensional concatenation, weighted summation, or attention fusion, and then transform it to the Transformer latent space through linear mapping to form a joint time-frequency representation; the combination method must maintain the complementarity of time and frequency information. The enhanced encoder module consists of a multi-layer Transformer encoder. Temporal local enhancement modules are selectively embedded after some encoder layers. The temporal local enhancement modules achieve local feature extraction through one-dimensional convolution, channel compression and restoration, and residual connection, and work with the self-attention mechanism to complete global and local feature modeling. The decoder module generates a fuel cell voltage degradation prediction sequence based on the time-frequency joint representation and autoregressive input.
[0010] Furthermore, the data preprocessing module includes a feature selection submodule, a data resampling submodule, a signal filtering submodule, and a standardization submodule. The feature selection submodule uses the Pearson correlation coefficient and Spearman rank correlation coefficient methods to select the seven variables most relevant to voltage changes as input features. The data resampling submodule uses a fixed-step moving average method, taking the average of every five consecutive samples as a new sample. The signal filtering submodule uses a Savitzky-Golay filter. The standardization submodule uses the Z-Score method, with parameters calculated only from the training set to avoid data leakage.
[0011] Furthermore, the feature filtering submodule uses the following calculation formula:
[0012] in, and These represent the input variable and the voltage output sample, respectively. , Its mean; Indicates the first The difference in the order of two variables for a sample and These represent the rank of the sample in its respective variable. The total number of samples; The data resampling submodule uses the following calculation formula:
[0013] in, Indicates the average window length. This represents the original sample size. The standardization submodule outputs preprocessed data, which serves as input for subsequent modules.
[0014] in, The input data is the raw sensor monitoring data value. and represents the mean and standard deviation of the features in the training set, respectively.
[0015] Furthermore, the extended Fourier transform unit of the frequency domain feature extraction module extends the input sequence in the time dimension to an integer multiple of the prediction window, and then performs a fast Fourier transform to obtain the frequency domain representation; the complex self-attention mechanism unit generates query, key, and value vectors through a complex weight matrix, and calculates attention weights based on the vector magnitude; the frequency domain reconstruction unit restores the weighted frequency domain features to the time domain sequence through an inverse Fourier transform.
[0016] Furthermore, the extended Fourier transform unit is calculated using the following formula: ; : Represents the standardized frequency domain feature matrix, used to enhance the stability of spectral data; : Represents the mean of the frequency domain characteristics; : The standard deviation representing the frequency domain characteristics; The number of frequency points; The complex self-attention mechanism unit is calculated using the following formula:
[0017]
[0018] : Represents the first in the multi-head attention mechanism One point of attention; They represent the first The complex linear transformation weight matrix corresponding to each query, key, and value; These represent the generated complex query vector, key vector, and value vector, respectively. Indicates the first The output of each attention head; The frequency domain reconstruction unit uses the following calculation formula:
[0019]
[0020] This represents the output of the F-Block module after frequency domain encoding, followed by inverse Fourier transform. recover; This represents the frequency domain reconstruction sequence of the final output prediction interval, with dimension . ,in To predict the window length.
[0021] Furthermore, the specific implementation steps of the temporal local enhancement module include: (1) Input rearrangement: The feature tensors input to the encoder layer are rearranged in the channel dimension and the time dimension to adapt to one-dimensional convolution;
[0022] (2) Channel compression: using kernel size k One-dimensional convolutions of 3 or 5 compress the channel dimension, with a compression ratio of... r The design is configured for 2-4, ensuring a lightweight design.
[0023] (3) Nonlinear activation: Apply the ReLU activation function to enhance the nonlinear expressive power of the model;
[0024] (4) Channel restoration: The channel dimension is restored to the original dimension by one-dimensional convolution, and the Dropout mechanism is applied to enhance the generalization ability;
[0025] (5) Residual connection: The processed features are fused with the original input features by residual connection to ensure that local enhancement does not interfere with the global attention path.
[0026] Furthermore, in the enhanced encoder module, the selective insertion strategy of the temporal local enhancement module is: it is inserted only after the shallow layers of the encoder, while the remaining layers maintain the original Transformer encoder structure; ; Indicates the first The output of the layer encoder; : The preset set of insertion layers, if This indicates that the ConvAdapter is inserted only at level 0; The fused features are fed into the encoder, where the complementary modeling of global and local features is achieved through the synergistic effect of the self-attention mechanism and the ConvAdapter.
[0027] : Represents the voltage prediction sequence of the final output of the model.
[0028] Furthermore, when the time-frequency fusion module uses channel-dimensional concatenation, the linear mapping satisfies the following: the combined feature dimensions are converted into a latent space dimension consistent with the Transformer model dimensions, and the mapping formula is as follows: ,in To represent the truncated temporal embedding features, Frequency domain characteristics derived from F-Block This is the weight matrix. For bias terms, This is the activation function.
[0029] Furthermore, the model is implemented based on the PyTorch framework, and the hyperparameter settings include: Batchsize of 128, Epochs of 100, Adam optimizer, MSE loss function, model dimension of 512, number of attention heads of 8, number of encoder layers of 2, and number of decoder layers of 1.
[0030] To achieve the above objectives, the present invention also provides a method for predicting fuel cell voltage degradation based on the above model, comprising the following steps: (1) Data input: Acquire multivariate monitoring data during the operation of the fuel cell, including voltage, current and temperature operating parameters; (2) Data preprocessing: The data preprocessing module performs feature screening, moving average resampling, Savitzky-Golay filtering and Z-Score standardization on the original monitoring data, and outputs the preprocessed input sequence. (3) Dual-branch feature extraction: The preprocessed input sequence is fed into the frequency domain feature extraction module and the time domain representation learning module respectively; the frequency domain branch outputs frequency domain features rich in global trends through extended Fourier transform, and the time domain branch outputs basic time domain features; (4) Time-frequency feature fusion: The time-frequency fusion module combines the frequency domain features and the time domain features by channel-dimensional splicing, weighted summation or attention fusion, and generates a joint time-frequency representation through linear mapping; (5) Enhanced coding: The time-frequency joint representation is input into the enhanced encoder module. Through the synergistic effect of the self-attention mechanism and the temporal local enhancement module, the comprehensive modeling of global long-range dependence and local dynamic features is completed. (6) Decline prediction: Based on the encoded features and autoregressive input, the decoder module generates the fuel cell voltage sequence for the future time period and completes the voltage decline trend prediction.
[0031] Beneficial effects: (1) Significantly improved prediction accuracy: By using a frequency-time dual-branch collaborative modeling mechanism, both long-term decay trends and local transient features are captured. Experimental results on the IEEE PHM2014 dataset show that this model significantly improves prediction accuracy in MSE, RMSE, and R. 2 The fusion model significantly outperforms traditional Transformer and single-module models in key metrics. On the FC1 (steady-state) dataset, the MSE of the fusion model is reduced to 0.888×10⁻⁶. -6 R² increased to 0.9910, compared to the baseline Transformer's MSE (2.974 × 10⁻⁶). -6 It improved by approximately 70%; on the FC2 (Dynamic Working Conditions) dataset, R... 2 The highest value reached 0.9994, indicating excellent prediction and fitting performance.
[0032] (2) Excellent multi-scale feature modeling capability: The F-Block module explicitly extracts periodic fluctuations and long-range trend information in the frequency domain, the ConvAdapter module accurately captures local transient features such as instantaneous fluctuations and steep drops in the time domain, and the time-frequency fusion module realizes the effective integration of multi-scale features, solving the technical pain point that existing models cannot take into account both the global and local aspects.
[0033] (3) Strong generalization across operating conditions: The dual-branch fusion architecture and complete data preprocessing process enable the model to adapt to complex and ever-changing operating conditions such as steady state and dynamic conditions. It maintains extremely high prediction performance under dynamic conditions and meets the diverse application scenarios in actual engineering.
[0034] (4) Efficient and lightweight model design: ConvAdapter adopts a bottleneck structure and selective insertion strategy. While introducing local perception capabilities, it only increases the number of computational parameters, avoiding a significant increase in model complexity and balancing prediction performance and computational efficiency.
[0035] (5) High robustness: The customized data preprocessing process (dual correlation coefficient feature screening + moving average resampling + Savitzky-Golay filtering) effectively overcomes the challenges of high noise, non-stationarity and dimensional redundancy in industrial monitoring data, ensuring that the model runs stably in complex data environments.
[0036] (6) Strong engineering practicality: It can be directly integrated into the predictive maintenance and health management (PHM) system of fuel cells, providing accurate decision-making basis for equipment maintenance, helping to prevent sudden failures, extend equipment service life, reduce the total life cycle cost, and promote the commercialization of fuel cell technology. Attached Figure Description
[0037] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a schematic diagram of the framework of the frequency-time collaborative enhancement Transformer model of the present invention; Figure 2 This is a schematic diagram of the F-Block principle of the present invention; Figure 3 This is a schematic diagram of the forward computation process of the ConvAdapter module of the present invention; Figure 4 This is the Top 7 feature selection diagram of the present invention; Figure 5 This is a comparison chart of voltage data before and after processing according to the present invention; Figure 6 This is a comparison chart of the prediction results of various models in FC1 of this invention; Figure 7 This is an error analysis diagram of each model in the FC1 of this invention; Figure 8 This is a comparison chart of errors in a single module of the present invention; Figure 9 This is a comparison chart of errors at different insertion positions of the ConvAdapter of the present invention; Figure 10 This is a comparison chart of errors in the F-Block+ConvAdapter fusion strategy of the present invention; Figure 11 This is a comparison chart of the prediction results of various FC2 models in this invention; Figure 12 This is an error analysis diagram of each model in the FC2 of this invention; The diagrams do not have specific component labels; they are all schematic representations of model architecture, data processing effects, or experimental results. Detailed Implementation
[0038] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0039] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0040] Example 1 See Figure 1-12 A frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction is characterized by comprising a data preprocessing module, a frequency domain feature extraction module (F-Block), a time domain representation learning module, a time-frequency fusion module, an enhanced encoder module, and a decoder module, with each module connected sequentially via a data stream to work collaboratively. The data preprocessing module is used to perform feature screening, data resampling, signal filtering and standardization on the raw fuel cell monitoring data, and output the normalized input data. The frequency domain feature extraction module (F-Block) is used to perform frequency domain transformation and feature extraction on the input data. It converts the time domain sequence into a frequency domain representation through an extended Fourier transform unit, models the correlation between frequencies through a complex self-attention mechanism, and then outputs a frequency domain representation rich in global periodicity and trend information through a frequency domain reconstruction unit. The extended Fourier transform can be replaced by other frequency domain analysis techniques with global frequency domain awareness capabilities, such as wavelet transform. The time-domain representation learning module is used to perform embedding processing and position encoding on the input data and output a basic time-domain representation; The time-frequency fusion module is used to combine the frequency domain representation with the basic time domain representation through channel-dimensional concatenation, weighted summation, or attention fusion, and then transform it to the Transformer latent space through linear mapping to form a joint time-frequency representation; the combination method must maintain the complementarity of time and frequency information. The enhanced encoder module consists of a multi-layer Transformer encoder, selectively embedding a temporal local enhancement module (ConvAdapter) after some encoder layers. The temporal local enhancement module (ConvAdapter) extracts local features through one-dimensional convolution, channel compression and restoration, and residual connections, and works in conjunction with the self-attention mechanism to complete global and local feature modeling. The decoder module generates a fuel cell voltage degradation prediction sequence based on the time-frequency joint representation and autoregressive input.
[0041] It should be noted that this embodiment breaks through the limitations of traditional single time-domain modeling and pioneers a dual-branch collaborative architecture of frequency domain feature extraction + time-domain local enhancement + time-frequency fusion, which solves the core pain points of weak local feature perception and insufficient utilization of frequency domain information in the standard Transformer.
[0042] This embodiment forms a complete technical chain of "data preprocessing → dual-branch feature extraction → time-frequency fusion → enhanced encoding → prediction generation" through the functional division of each module and data flow logic. Compared with existing model-driven methods (which rely on complex physical modeling) and traditional data-driven methods (modeling with a single feature dimension), it has stronger adaptability and more comprehensive modeling.
[0043] In a specific example, the data preprocessing module includes a feature selection submodule, a data resampling submodule, a signal filtering submodule, and a normalization submodule, see [link to relevant documentation]. Figure 4 The feature selection submodule uses Pearson correlation coefficient and Spearman rank correlation coefficient methods to select the seven variables most relevant to voltage changes as input features; the data resampling submodule uses a fixed-step moving average method, taking the average of every five consecutive samples as a new sample, thereby smoothing noise and reducing data size; for example... Figure 5 The signal filtering submodule uses a Savitzky-Golay filter; the normalization submodule uses the Z-Score method, and the parameters are calculated only from the training set to avoid data leakage.
[0044] This embodiment employs a combined preprocessing scheme of "dual correlation coefficient feature screening + moving average resampling + Savitzky-Golay filtering + Z-Score standardization" to specifically address the pain points of industrial monitoring data, such as "high noise, dimensional redundancy, and non-stationarity." Compared to existing single preprocessing methods (such as standardization alone), the data quality improvement is more significant. Specific parameters are clearly defined, such as "screening seven voltage-related features" (air inlet flow rate, current, current density, air outlet pressure, inlet humidity, cooling water flow rate, and hydrogen inlet flow rate) and "resampling the mean of every five samples." This makes the preprocessing process quantifiable and reproducible, avoiding the model instability issues caused by ambiguous preprocessing steps in existing technologies. The emphasis on standardization parameters being "calculated only from the training set" effectively avoids data leakage, and compared to existing technologies without clearly defined data partitioning rules, the model's generalization ability is more guaranteed.
[0045] In a specific example, the feature filtering submodule uses the following calculation formula:
[0046] in, and These represent the input variable and the voltage output sample, respectively. , Its mean; Indicates the first The difference in the order of two variables for a sample and These represent the rank of the sample in its respective variable. The total number of samples; The data resampling submodule uses the following calculation formula:
[0047] in, Indicates the average window length. This represents the original sample size. The standardization submodule outputs preprocessed data, which serves as input for subsequent modules.
[0048] in, The input data is the raw sensor monitoring data value. and represents the mean and standard deviation of the features in the training set, respectively.
[0049] This embodiment solidifies the core logic of feature selection, resampling, and standardization through precise formulas, making the technical solution more feasible. Compared with existing technologies that only describe the method name without specifying the calculation logic, it avoids "method implementation deviations." The combined use of the Pearson + Spearman dual correlation coefficient formula captures both linear correlation features and covers nonlinear correlation variables. Compared with single correlation coefficient selection methods, the feature selection is more comprehensive and accurate. The fixed step size k=5 in the moving average formula balances the noise smoothing effect with data resolution preservation. Compared with resampling schemes without fixed step sizes, it is more suitable for the time-series characteristics of fuel cell voltage data.
[0050] In a specific instance, such as Figure 2 As shown: The extended Fourier transform unit of the frequency domain feature extraction module (F-Block) expands the input sequence in the time dimension to an integer multiple of the prediction window, and then performs a fast Fourier transform (FFT) to obtain the frequency domain representation; the complex self-attention mechanism unit generates query, key, and value vectors through a complex weight matrix, and calculates attention weights based on the vector magnitude; the frequency domain reconstruction unit restores the weighted frequency domain features to the time domain sequence through an inverse Fourier transform.
[0051] This embodiment innovatively proposes a frequency domain feature extraction logic of "extended Fourier transform + complex self-attention + inverse Fourier transform". Through the process of "time dimension extension → frequency domain transformation → frequency correlation modeling → time domain recovery", it explicitly captures the periodic fluctuations and long-range decay trends of voltage sequences, solving the shortcoming of existing technologies that "only focus on the time domain and ignore the hidden patterns in the frequency domain". It clarifies the core steps of the complex self-attention mechanism of "vector generation → weight calculation → feature weighting". Compared with the limitation of traditional self-attention mechanisms that can only process time domain information, it achieves accurate modeling of frequency correlation in the frequency domain. The frequency domain reconstruction unit recovers time domain features through inverse Fourier transform, ensuring that frequency domain information can be directly fused with time domain features, avoiding the problems of "feature fragmentation and difficulty in reuse" in existing frequency domain analysis methods.
[0052] In a specific instance, the extended Fourier transform unit is calculated using the following formula: ; : Represents the standardized frequency domain feature matrix, used to enhance the stability of spectral data; : Represents the mean of the frequency domain characteristics; : The standard deviation representing the frequency domain characteristics; The number of frequency points; The complex self-attention mechanism unit is calculated using the following formula:
[0053]
[0054] : Represents the first in the multi-head attention mechanism One point of attention; They represent the first The complex linear transformation weight matrix corresponding to each query, key, and value; These represent the generated complex query vector, key vector, and value vector, respectively. Indicates the first The output of each attention head; The frequency domain reconstruction unit uses the following calculation formula:
[0055]
[0056] This represents the output of the F-Block module after frequency domain encoding, followed by inverse Fourier transform. recover; This represents the frequency domain reconstruction sequence of the final output prediction interval, with dimension . ,in To predict the window length.
[0057] This embodiment explicitly defines the specific logic of the extended Fourier transform unit, complex self-attention weight calculation, and frequency domain reconstruction through formulas, making the frequency domain feature extraction process quantifiable and verifiable. Compared with the vague description of "using Fourier transform" in existing technologies, the technical details are more solid. The complex self-attention formula calculates weights based on "vector magnitude," adapting to the characteristics of the complex representation in the frequency domain. Compared with the real-domain attention mechanism, it can more accurately capture the correlation between frequencies. The frequency domain reconstruction formula extracts feature segments that match the prediction window, ensuring the dimensionality consistency between frequency domain features and time domain features. This provides technical support for subsequent time-frequency fusion and avoids the problem of "feature dimension mismatch" in existing fusion schemes.
[0058] In a specific instance, the implementation steps of the temporal local enhancement module (ConvAdapter) include: (1) Input rearrangement: The feature tensors input to the encoder layer are rearranged in the channel dimension and the time dimension to adapt to one-dimensional convolution;
[0059] (2) Channel compression: One-dimensional convolution with kernel size k of 3 or 5 is used to compress the channel dimension, with a compression ratio r of 2-4, to ensure lightweight design;
[0060] (3) Nonlinear activation: Apply the ReLU activation function to enhance the nonlinear expressive power of the model;
[0061] (4) Channel restoration: The channel dimension is restored to the original dimension by one-dimensional convolution, and the Dropout mechanism is applied to enhance the generalization ability;
[0062] (5) Residual connection: The processed features are fused with the original input features by residual connection to ensure that local enhancement does not interfere with the global attention path.
[0063] It should be noted that the structure of the temporal local enhancement module (ConvAdapter) is as follows: Figure 3 As shown, this is a lightweight convolution adapter that introduces a local receptive field through a bottleneck structure.
[0064] In a specific example, the selective insertion strategy of the temporal local enhancement module (ConvAdapter) in the enhanced encoder module is: it is inserted only after the shallow layers of the encoder (layer 0, layer 1 and / or layer 2), while the remaining layers maintain the original Transformer encoder structure; ; Indicates the first The output of the layer encoder; : The preset set of insertion layers, if This indicates that the ConvAdapter is inserted only at level 0; The fused features are fed into the encoder, where the complementary modeling of global and local features is achieved through the synergistic effect of the self-attention mechanism and the ConvAdapter.
[0065] : Represents the voltage prediction sequence of the final output of the model.
[0066] It's important to note that the ConvAdapter module is not inserted into all layers of the encoder, but rather as needed based on the hierarchical structure. For example, ConvAdapter is only applied when the layer index l is 0 or 1; otherwise, the original structure is maintained. Experiments show that shallow insertion yields the best results. This strategy allows the model to achieve local enhancements to key layers with only a few parameter increments.
[0067] In a specific example, when the time-frequency fusion module uses channel-dimensional concatenation, the linear mapping satisfies the following: the combined feature dimensions are converted into a latent space dimension consistent with the Transformer model dimensions, and the mapping formula is as follows: ,in To represent the truncated temporal embedding features, Frequency domain characteristics derived from F-Block This is the weight matrix. For bias terms, This is the activation function.
[0068] It should be noted that if a weighted summation or attention fusion method is used, the mapping formula should be adapted and adjusted to the calculation logic after combining the corresponding features.
[0069] In a specific example, the model is implemented based on the PyTorch framework, and the hyperparameter settings include: Batchsize of 128, Epochs of 100, Adam optimizer, MSE loss function, model dimension of 512, number of attention heads of 8, number of encoder layers of 2, and number of decoder layers of 1.
[0070] Experimental verification results: Experimental data: This model was systematically validated on the FC1 and FC2 datasets. The specific results are shown in Tables 1 and 2.
[0071] Table 1 shows the ablation study results of the FC1 dataset under steady-state conditions.
[0072] Table 2 Generalization performance of the FC2 dataset under dynamic conditions
[0073] See Figure 6-12 : Figure 6 (Comparison of prediction results from various FC1 models) Scenario: Steady-state operating conditions (FC1 dataset) Key Explanation: A direct comparison of the voltage prediction curves of the model of this invention (F-Block+ConvAdapter combination) with those of traditional Transformer and single-module enhancement models.
[0074] Key findings: The predicted curve of the model in this invention almost completely coincides with the ground truth, while the traditional Transformer and single-module models show significant deviations, proving that it has a better fitting ability for long-term decay trends under steady-state conditions.
[0075] Figure 7(Error analysis charts for each FC1 model) Scenario: Steady-state operating conditions (FC1 dataset) Key Explanation: This section provides a quantitative representation of the prediction error distribution (such as MSE, RMSE, etc.) for each model.
[0076] Key findings: The model of this invention (F-Block+ConvAdapter@0&1) has the smallest and most concentrated error values, verifying that its prediction accuracy under steady-state conditions is significantly better than other models (MSE as low as 0.888×10). -6 ).
[0077] Figure 8 (Single module error comparison chart) Key takeaway: Verify the function of the F-Block and ConvAdapter modules separately, and compare their error differences with those of the traditional Transformer.
[0078] Key findings: Adding either F-Block or ConvAdapter can reduce errors, but their individual effects are limited, providing data support for the necessity of "dual-module collaboration".
[0079] Figure 9 (Comparison chart of errors for ConvAdapter at different insertion positions) Key Explanation: Compare the error performance of ConvAdapter when inserting encoders at different levels (layer 0, layer 1, and layers 0 & 1).
[0080] Key conclusion: The error of insertion into shallow layers (layer 0, layer 1) is significantly lower than that of other positions, confirming the technical feature of "best shallow insertion effect" in the claims.
[0081] Figure 10 (Comparison chart of F-Block + ConvAdapter fusion strategy errors) Key Explanation: This study specifically verifies the effect of fusing "frequency domain + time domain" dual modules and compares the errors of different fusion combinations.
[0082] Key findings: The F-Block and ConvAdapter work together to achieve the lowest error, directly proving that "frequency-time synergistic enhancement" is the core mechanism for improving prediction accuracy.
[0083] Figure 11 (Comparison of prediction results from various FC2 models) Scenario: Dynamic operating conditions (FC2 dataset) Key Explanation: Under complex dynamic load conditions, compare the degree of fit between the predicted curves of each model and the actual values.
[0084] Key findings: The model of this invention can still accurately reflect the actual voltage decay trend, while the traditional model has obvious deviations, proving its strong generalization ability across operating conditions.
[0085] Figure 12 (Error analysis charts for each FC2 model) Scenario: Dynamic operating conditions (FC2 dataset) Key Explanation: Quantitatively compare the error indices (such as R) of various models under dynamic operating conditions. 2 , MAE, etc.) Key conclusion: The R-value of the model in this invention 2 With an error index as high as 0.9994, it achieves the best performance and further verifies its stability and reliability under complex working conditions.
[0086] Therefore, it can be seen that: Figure 6-12 A complete experimental verification chain is formed: from steady state to dynamic conditions, from qualitative curve comparison to quantitative error analysis, from the effect of a single module to the synergistic effect of two modules, comprehensively demonstrating that the core innovations of this invention (F-Block frequency domain extraction, ConvAdapter local enhancement, and time-frequency fusion) can effectively solve the technical pain points of existing models and significantly improve prediction accuracy and generalization ability.
[0087] In summary, the MSE of the model (F-Block+ConvAdapter@0&1) in this embodiment of the FC1 dataset (steady-state condition) is as low as 0.888×10⁻⁶. -6 The RMSE is 0.943 × 10⁻⁶. -3 The MAE is 2.416 × 10 -4 R 2 The accuracy reached 0.9910, and all indicators were significantly better than the traditional Transformer and single-module enhancement models, demonstrating excellent fitting ability for long-range decay trends under steady-state conditions. FC2 dataset (dynamic conditions): The MSE of the model of this invention (F-Block+ConvAdapter@1) is as low as 0.356×10⁻⁶. -6 The RMSE is 0.597 × 10⁻⁶. -3 MAE is 2.405×10 -4 R 2 The accuracy reached 0.9994, maintaining the best prediction performance under dynamic and complex working conditions, which verified the model's strong generalization ability. Ablation experiments: The effectiveness of F-Block, ConvAdapter and different insertion strategies were verified respectively. The results show that the frequency-time co-enhancement mechanism can significantly improve the multi-scale feature modeling ability of the model, which is the core reason for the improvement of prediction accuracy.
[0088] The above experimental results fully verify the effectiveness and superiority of the technical solution of the present invention. This model can accurately capture the global trend and local details of fuel cell voltage decay, providing reliable support for predictive maintenance of fuel cells.
[0089] Example 2 To achieve the above objectives, this embodiment also provides a fuel cell voltage degradation prediction method based on the above model, including the following steps: (1) Data input: Acquire multivariate monitoring data during the operation of the fuel cell, including voltage, current and temperature operating parameters; (2) Data preprocessing: The data preprocessing module performs feature screening, moving average resampling, Savitzky-Golay filtering and Z-Score standardization on the original monitoring data (the standardization parameters are calculated only from the training set), and outputs the preprocessed input sequence. (3) Dual-branch feature extraction: The preprocessed input sequence is fed into the frequency domain feature extraction module (F-Block) and the time domain representation learning module respectively; the frequency domain branch outputs frequency domain features rich in global trends through extended Fourier transform (or wavelet transform or other frequency domain analysis techniques with frequency domain global perception capabilities), and the time domain branch outputs basic time domain features; (4) Time-frequency feature fusion: The time-frequency fusion module combines the frequency domain features and the time domain features by channel-dimensional splicing, weighted summation or attention fusion (keeping the time-frequency information complementary), and generates a joint time-frequency representation through linear mapping; (5) Enhanced coding: The time-frequency joint representation is input into the enhanced encoder module. Through the synergistic effect of the self-attention mechanism and the temporal local enhancement module (ConvAdapter) (ConvAdapter uses a convolution kernel of size 3 or 5, a compression ratio of 2-4, and is only inserted into the shallow layer of the encoder), the comprehensive modeling of global long-range dependencies and local dynamic features is completed. (6) Decline prediction: Based on the encoded features and autoregressive input, the decoder module generates the fuel cell voltage sequence for the future time period and completes the voltage decline trend prediction.
[0090] The fuel cell voltage degradation prediction method in this embodiment has the same advantages over the prior art as the frequency-time co-enhanced Transformer model for PEMFC voltage degradation prediction described above, and will not be repeated here.
[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction, characterized in that, It includes a data preprocessing module, a frequency domain feature extraction module, a time domain representation learning module, a time-frequency fusion module, an enhanced encoder module, and a decoder module. Each module is connected and works collaboratively through a data stream. The data preprocessing module is used to perform feature screening, data resampling, signal filtering and standardization on the raw fuel cell monitoring data, and output the normalized input data. The frequency domain feature extraction module is used to perform frequency domain transformation and feature extraction on the input data. It converts the time domain sequence into a frequency domain representation through the extended Fourier transform unit, models the correlation between frequencies through a complex self-attention mechanism, and then outputs a frequency domain representation rich in global periodicity and trend information through the frequency domain reconstruction unit. The time-domain representation learning module is used to perform embedding processing and position encoding on the input data and output a basic time-domain representation; The time-frequency fusion module is used to combine the frequency domain representation with the basic time domain representation through channel-dimensional concatenation, weighted summation, or attention fusion, and then transform it to the Transformer latent space through linear mapping to form a joint time-frequency representation; the combination method must maintain the complementarity of time and frequency information. The enhanced encoder module consists of a multi-layer Transformer encoder. Temporal local enhancement modules are selectively embedded after some encoder layers. The temporal local enhancement modules achieve local feature extraction through one-dimensional convolution, channel compression and restoration, and residual connection, and work with the self-attention mechanism to complete global and local feature modeling. The decoder module generates a fuel cell voltage degradation prediction sequence based on the time-frequency joint representation and autoregressive input.
2. The frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction according to claim 1, characterized in that, The data preprocessing module includes a feature selection submodule, a data resampling submodule, a signal filtering submodule, and a standardization submodule. The feature selection submodule uses the Pearson correlation coefficient and Spearman rank correlation coefficient method to select the seven variables most related to voltage changes as input features. The data resampling submodule uses a fixed-step moving average method, taking the average of every 5 consecutive samples as a new sample; the signal filtering submodule uses a Savitzky-Golay filter; and the standardization submodule uses the Z-Score method, with parameters calculated only from the training set to avoid data leakage.
3. The frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction according to claim 2, characterized in that, The feature filtering submodule uses the following calculation formula: in, and These represent the input variable and the voltage output sample, respectively. , Its mean; Indicates the first The difference in the order of two variables for a sample and These represent the rank of the sample in its respective variable. The total number of samples; The data resampling submodule uses the following calculation formula: in, Indicates the average window length. This represents the original sample size. The standardization submodule outputs preprocessed data, which serves as input for subsequent modules. in, The input data is the raw sensor monitoring data value. and represents the mean and standard deviation of the features in the training set, respectively.
4. The frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction according to claim 1, characterized in that, The extended Fourier transform unit of the frequency domain feature extraction module extends the input sequence in the time dimension to an integer multiple of the prediction window, and then performs a fast Fourier transform to obtain the frequency domain representation; the complex self-attention mechanism unit generates query, key, and value vectors through a complex weight matrix, and calculates attention weights based on the vector magnitude; the frequency domain reconstruction unit restores the weighted frequency domain features to the time domain sequence through an inverse Fourier transform.
5. The frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction according to claim 4, characterized in that, The extended Fourier transform unit is calculated using the following formula: ; : Represents the standardized frequency domain feature matrix, used to enhance the stability of spectral data; : Represents the mean of the frequency domain characteristics; : The standard deviation representing the frequency domain characteristics; The number of frequency points; The complex self-attention mechanism unit is calculated using the following formula: : Represents the first in the multi-head attention mechanism One point of attention; They represent the first The complex linear transformation weight matrix corresponding to each query, key, and value; These represent the generated complex query vector, key vector, and value vector, respectively. Indicates the first The output of each attention head; The frequency domain reconstruction unit uses the following calculation formula: This represents the output of the F-Block module after frequency domain encoding, followed by inverse Fourier transform. recover; This represents the frequency domain reconstruction sequence of the final output prediction interval, with dimension . ,in To predict the window length.
6. The frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction according to claim 1, characterized in that, The specific implementation steps of the temporal local enhancement module include: (1) Input rearrangement: The feature tensors input to the encoder layer are rearranged in the channel dimension and the time dimension to adapt to one-dimensional convolution; (2) Channel compression: using kernel size k One-dimensional convolutions of 3 or 5 compress the channel dimension, with a compression ratio of... r The design is configured for 2-4, ensuring a lightweight design. (3) Nonlinear activation: Apply the ReLU activation function to enhance the nonlinear expressive power of the model; (4) Channel restoration: The channel dimension is restored to the original dimension by one-dimensional convolution, and the Dropout mechanism is applied to enhance the generalization ability; (5) Residual connection: The processed features are fused with the original input features by residual connection to ensure that local enhancement does not interfere with the global attention path.
7. The frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction according to claim 1, characterized in that, In the enhanced encoder module, the selective insertion strategy of the temporal local enhancement module (ConvAdapter) is: it is inserted only after the shallow layers of the encoder, while the remaining layers maintain the original Transformer encoder structure; ; Indicates the first The output of the layer encoder; : The preset set of insertion layers, if This indicates that the ConvAdapter is inserted only at level 0; The fused features are fed into the encoder, where the complementary modeling of global and local features is achieved through the synergistic effect of the self-attention mechanism and the ConvAdapter. : Represents the voltage prediction sequence of the final output of the model.
8. The frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction according to claim 1, characterized in that, When the time-frequency fusion module uses channel-dimensional concatenation, the linear mapping satisfies the following: the combined feature dimensions are converted into a latent space dimension consistent with the Transformer model dimensions, and the mapping formula is: ,in To represent the truncated temporal embedding features, Frequency domain characteristics derived from F-Block This is the weight matrix. For bias terms, This is the activation function.
9. The frequency-time co-enhanced Transformer model for PEMFC voltage decay prediction according to claim 1, characterized in that, The model is implemented based on the PyTorch framework, and the hyperparameter settings include: Batchsize of 128, Epochs of 100, Adam optimizer, MSE loss function, model dimension of 512, number of attention heads of 8, number of encoder layers of 2, and number of decoder layers of 1.
10. A method for predicting fuel cell voltage degradation based on any one of the models described in claims 1-9, characterized in that, Includes the following steps: (1) Data input: Acquire multivariate monitoring data during the operation of the fuel cell, including voltage, current and temperature operating parameters; (2) Data preprocessing: The data preprocessing module performs feature screening, moving average resampling, Savitzky-Golay filtering and Z-Score standardization on the original monitoring data, and outputs the preprocessed input sequence. (3) Dual-branch feature extraction: The preprocessed input sequence is fed into the frequency domain feature extraction module and the time domain representation learning module respectively; the frequency domain branch outputs frequency domain features rich in global trends through extended Fourier transform, and the time domain branch outputs basic time domain features; (4) Time-frequency feature fusion: The time-frequency fusion module combines the frequency domain features and the time domain features by channel-dimensional splicing, weighted summation or attention fusion, and generates a joint time-frequency representation through linear mapping; (5) Enhanced coding: The time-frequency joint representation is input into the enhanced encoder module. Through the synergistic effect of the self-attention mechanism and the temporal local enhancement module, the comprehensive modeling of global long-range dependence and local dynamic features is completed. (6) Decline prediction: Based on the encoded features and autoregressive input, the decoder module generates the fuel cell voltage sequence for the future time period and completes the voltage decline trend prediction.