Transformer-Based Lithium Battery State of Health Estimation Method
Through the Transformer-based lithium battery health status estimation method, combined with CEEMDAN decomposition and improved sparrow search algorithm, the problems of insufficient long-term dependence and feature extraction capabilities in the existing technology are solved, and higher prediction accuracy and stability are achieved.
Patent Information
- Application Number
- CN202510336833.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-21
AI Technical Summary
The prior art has long-dependence problems in estimating the health status of lithium-ion batteries, making it difficult to capture long-distance information, has weak feature extraction capabilities, and is prone to the problem of gradient disappearance or explosion.
The lithium battery health status estimation method based on Transformer is adopted, and the lithium-ion battery aging data set is established, outlier processing and feature extraction is performed, and the eigenmodal functions of different frequencies are obtained using the CEEMDAN decomposition algorithm, and the intrinsic mode function of different frequencies is improved by combining sin chaotic mapping, adaptive dynamic weighting factor and reverse learning-Caucy alternating strategy to improve the sparrow search algorithm and optimize the Transformer model.
The prediction accuracy of the model is improved, the error caused by noise is reduced, the convergence and robustness of the model is enhanced, the time complexity of the algorithm is reduced, and the accuracy and stability of the prediction are enhanced.
Smart Images

Figure CN119846485B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of lithium-ion battery state prediction, and particularly relates to a method for estimating the state of health of a lithium battery based on Transformer. Background Technique
[0002] Among many energy storage technologies, the market share of battery energy storage systems (BESS) has exceeded 30%, and this proportion continues to grow, especially in grid-scale and distributed energy storage applications. Lithium-ion batteries are widely used in electric vehicle charging stations, renewable energy smooth supply, and grid frequency and voltage regulation due to their advantages such as high energy density, long service life, fast charge and discharge ability, low self-discharge rate, and relatively low maintenance cost. The proportion of lithium-ion batteries in the global BESS market has exceeded 80% and has become the mainstream choice.
[0003] Currently, the commonly used methods for estimating the state of health (SOH) of lithium-ion batteries mainly include two categories: model-based methods and data-driven methods. Model-based methods include electrochemical models, equivalent circuit models, etc. However, these methods require the establishment of complex models and cannot fully capture the nonlinear behavior of the battery, and their estimation accuracy often depends on the accuracy of model parameters. With the development of artificial intelligence technology, more and more scholars have begun to use data-driven methods to estimate the SOH of batteries. This type of method does not require the construction of a physical model, but directly uses the charge and discharge voltage, current, and temperature data of the battery for learning, can reveal the complex nonlinear relationship between the SOH and characteristic factors, and has strong adaptability and high real-time performance. Data-driven methods usually include regression models, support vector machines (SVM), extreme learning machines (ELM), Bayesian networks, and neural networks. However, neural networks are prone to long-dependency problems when processing long sequences, making it difficult to capture long-distance information. Their feature extraction ability is relatively weak and may not be able to fully capture complex patterns and relationships. At the same time, neural networks may face problems of gradient disappearance or explosion when expanding. Summary of the Invention
[0004] In order to solve the problems existing in the prior art, the present invention provides a method for estimating the state of health of a lithium battery based on Transformer. Accurately estimating the state of health (SOH) helps users optimize the use of the battery and ensure the reliability and safety of the device during use.
[0005] To achieve the above object, the present invention provides the following solution:
[0006] A method for estimating the state of health of a lithium battery based on Transformer, the method comprising:
[0007] Based on the basic structure and working characteristics of a lithium-ion battery, establish an aging dataset of lithium-ion batteries;
[0008] Perform outlier processing and feature extraction on the aging dataset of the lithium-ion battery to obtain feature factors;
[0009] Calculate the correlation between the feature factors and the original capacity sequence of the lithium-ion battery to obtain feature factors that meet the preset correlation threshold;
[0010] Decompose the original capacity sequence based on the complete adaptive noise ensemble empirical mode decomposition algorithm to obtain intrinsic mode functions of different frequencies;
[0011] Use the feature factors that meet the preset correlation threshold as the input sequence of the Transformer model, and use the intrinsic mode functions as the prediction sequence of the transformer model to train the Transformer model;
[0012] Combine the sine chaotic mapping, adaptive dynamic weight factor and reverse learning-Cauchy alternating mutation strategy to improve the sparrow search algorithm, and use the improved sparrow search algorithm to optimize the trained Transformer model to obtain a lithium-ion battery health state estimation model;
[0013] Based on the lithium-ion battery health state estimation model, estimate the health state of the lithium-ion battery to be estimated to obtain the lithium-ion battery health state estimation value.
[0014] Optionally, the method for obtaining intrinsic mode functions of different frequencies includes:
[0015] Add white noise to the original capacity sequence to obtain a noisy capacity sequence;
[0016] Perform empirical mode decomposition on the noisy capacity sequence to obtain the first intrinsic mode function;
[0017] Average the first intrinsic mode function to obtain the first mode component of the original capacity sequence after complete adaptive noise ensemble empirical mode decomposition;
[0018] Remove the first mode component from the original capacity sequence to obtain the first residual sequence;
[0019] Add new white noise to the first residual sequence to obtain a noisy residual sequence;
[0020] Perform empirical mode decomposition on the noisy residual sequence to obtain the second mode component of the original capacity sequence;
[0021] Remove the second mode component from the first residual sequence to obtain the second residual sequence;
[0022] Repeatedly extract the modal components of the residual sequence until the remaining residual sequence meets the preset requirements, and obtain the intrinsic mode functions with different frequencies.
[0023] Optionally, the Transformer model includes an input block, an encoder, a decoder, and an output block; among them, both the encoder and the decoder include multiple stacked attention layers and feed-forward networks, and the decoder further includes a masked multi-head attention layer.
[0024] Optionally, the method for improving the sparrow search algorithm includes:
[0025] Perform population initialization on the sparrow search algorithm based on the sin chaotic map with an infinite number of mapping folds to obtain the population individual positions after mapping;
[0026] Based on a preset fitness function, divide the population individuals into discoverers and followers; among them, the discoverers are used to explore the location where the global optimal solution is located, and the followers are used to perform local search around the discoverers;
[0027] Introduce an adaptive dynamic weight factor to update the positions of the discoverers and followers to obtain the current global optimal solution;
[0028] Based on the reverse learning-Cauchy alternating mutation strategy, perturb the current global optimal solution to obtain a new solution;
[0029] Based on the elite principle, compare the fitness values of the positions of the new solution and the current global optimal solution, and based on the fitness values, determine whether to update the position where the current global optimal solution is located.
[0030] Optionally, the method for obtaining the population individual positions after mapping includes:
[0031] Generate a chaotic sequence based on the sin chaotic map with an infinite number of mapping folds:
[0032] ,
[0033] Linearly map the generated chaotic sequence to the search space:
[0034] ,
[0035] where, is the chaotic sequence, x n is a variable in the sin chaotic map, representing the nth value in the chaotic sequence, and are respectively the lower and upper limits of the search variable, is the th value of the chaotic sequence, is the population individual position after mapping.
[0036] Optionally, introducing an adaptive dynamic weight factor, the method for updating the positions of the discoverer and the follower includes:
[0037] Based on the adaptive dynamic weight factor and the global optimal solution generated during the position update iteration process, update the position of the discoverer, and the update formula is as follows:
[0038]
[0039] In the formula, represents the position of the th discoverer individual in the th dimension at the th iteration; represents the global optimal solution in the th iteration; is a random number obeying the normal distribution of [0, 1], F is the warning value, S is the safety value; rand is a random generation function used to generate random numbers; is the adaptive dynamic weight factor; represents the maximum number of iterations;
[0040] Based on the position of the discoverer and the current globally worst individual, update the position of the follower, and the update formula is as follows:
[0041] ,
[0042] In the formula, represents the current globally worst individual; is the position of the th discoverer; is used to adjust the displacement direction; is a matrix, and each element in the matrix is 1. M is the total number of individuals in the sparrow search algorithm.
[0043] Optionally, optimizing the trained Transformer model using the improved sparrow search algorithm includes optimizing the number of attention mechanism heads, the initial learning rate, and the L2 regularization coefficient of the Transformer model.
[0044] Compared with the prior art, the beneficial effects of the present invention are:
[0045] 1. Using CEEMDAN decomposition to eliminate the high-frequency IMFs containing capacity regeneration noise, thereby ensuring that the feature sequence input into the model is cleaner. This noise elimination mechanism improves the prediction accuracy of the model, reduces the errors caused by noise, and at the same time effectively reduces the time complexity of the algorithm while maintaining the same space complexity, enhancing the convergence and robustness of the model.
[0046] 2. The use of the sin chaotic map to replace the random initialization of the population reduces the risk of the algorithm falling into the local optimal solution. A time-varying weight factor is introduced into the individual position update formula to expand the search range and achieve local precise development. The reverse learning-Cauchy mutation alternating mutation strategy balances the global exploration and local development capabilities. The SSA optimized by multi-strategy fusion is used to set the parameters of the Transformer model, improve the model learning efficiency, enable it to adaptively find the optimal hyperparameter combination, and enhance the accuracy and stability of prediction. Brief Description of the Drawings
[0047] To more clearly illustrate the technical solutions of the present invention, the drawings required in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0048] Figure 1 Flowchart of the lithium battery state of health estimation method based on Transformer according to the embodiment of the present invention;
[0049] Figure 2 Schematic diagram of the Transformer network architecture according to the embodiment of the present invention;
[0050] Figure 3 Flowchart of the overall algorithm framework of CEEMDAN-ISSA-Transformer according to the embodiment of the present invention;
[0051] Figure 4 Curve of the capacity change of the CS2_35 battery according to the embodiment of the present invention;
[0052] Figure 5 Voltage-current change of the CS2_35 battery at the initial number of cycles according to the embodiment of the present invention; among them, (a) is the voltage change of CS2_35; (b) is the current change of CS2_35;
[0053] Figure 6 Schematic diagram of the change of HI1-HI3 of the CS2_35 battery with battery aging according to the embodiment of the present invention; among them, (a) is the change of HI1 of the CS2 series battery with battery aging; (b) is the change of HI2 of the CS2 series battery with battery aging; (c) is the change of HI3 of the CS2 series battery with battery aging;
[0054] Figure 7Schematic diagram of the time-domain decomposition of the original capacity by CEEMDAN according to an embodiment of the present invention; among them, (a) is the first mode function IMF1 of the original capacity signal of the CS2-35 battery; (b) is the first mode function IMF2 of the original capacity signal of the CS2-35 battery; (c) is the first mode function IMF3 of the original capacity signal of the CS2-35 battery; (d) is the first mode function IMF4 of the original capacity signal of the CS2-35 battery; (e) is the first mode function IMF5 of the original capacity signal of the CS2-35 battery; (f) is the first mode function IMF6 of the original capacity signal of the CS2-35 battery; (g) is the first mode function IMF7 of the original capacity signal of the CS2-35 battery; (h) is the first mode function IMF8 of the original capacity signal of the CS2-35 battery;
[0055] Figure 8 Schematic diagram comparing the prediction results of the CS2-35 battery under four different models with the SOH reference value according to an embodiment of the present invention. Detailed implementation manners
[0056] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0057] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below in conjunction with the drawings and specific implementation manners.
[0058] The state of health (SOH) is a key indicator in the battery management system, which measures the degree of reduction in the battery's ability to store and release electrical energy relative to a new battery. There are many ways to define SOH, and the most commonly used one is based on capacity, that is, the current actual available capacity compared with the initial capacity of the battery The specific expression is as follows:
[0059]
[0060] Generally, it is considered that when the battery capacity decays to 80% of the initial capacity, its life ends. Therefore, it is of great significance to accurately estimate SOH using advanced monitoring technologies for optimizing charge and discharge strategies, extending battery life, reducing maintenance costs, and enhancing user experience. How to quickly and accurately estimate the SOH of lithium-ion batteries is also a major challenge in the current energy storage system field.
[0061] Embodiment 1
[0062] As Figure 1 shown, the method for estimating the state of health of a lithium battery based on a Transformer includes:
[0063] S1: Establish an aging dataset of lithium-ion batteries based on the basic structure and working characteristics of lithium-ion batteries;
[0064] S2: Perform outlier processing and feature extraction on the aging dataset of lithium-ion batteries to obtain feature factors;
[0065] S3: Calculate the correlation between the feature factors and the original capacity sequence of the lithium-ion battery to obtain feature factors that meet the preset correlation threshold;
[0066] S4: Decompose the original capacity sequence based on the Complete Ensemble Empirical Mode Decomposition with Adaptive Noise (CEEMDAN) algorithm to obtain intrinsic mode functions of different frequencies. CEEMDAN is an improved EMD technique that is commonly used to decompose non-linear or non-stationary signals into several intrinsic mode functions with special meanings at different frequencies and a residual signal, effectively solving the problem of residual noise in EEMD.
[0067] Furthermore, the implementation method for obtaining intrinsic mode functions of different frequencies includes:
[0068] S41: Add white noise to the original capacity sequence to obtain a noisy capacity sequence; specifically, let the original capacity sequence be C(n), is the standard deviation of the Gaussian white noise that can be adaptively decomposed, used to control the amplitude of the noise.
[0069] Add the noise to the original capacity sequence C(n) to obtain a noisy capacity sequence:
[0070] ;
[0071] where represents the white noise sequence, represents the th noise addition.
[0072] S42: Perform empirical mode decomposition on the noisy capacity sequence to obtain the first intrinsic mode function;
[0073] S43: Average the first intrinsic mode function to obtain the first modal component of the original capacity sequence after complete ensemble empirical mode decomposition with adaptive noise; in this embodiment, average the first IMFs obtained by decomposing all noises to obtain the first modal component of the original signal through CEEMDAN .
[0074] ; (2)
[0075] In the formula, represents the number of times of noise addition; is the operator of the first-order mode when decomposing the classical EMD sequence.
[0076] S44: Remove the first modal component from the original capacity sequence to obtain the first residual sequence; specifically, in the original capacity sequence remove the first modal component to obtain the first residual sequence :
[0077] ; (3)
[0078] S45: Add new white noise to the first residual sequence to obtain the noise-added residual sequence; perform empirical mode decomposition on the noise-added residual sequence to obtain the second modal component of the original capacity sequence; specifically, add new white noise to the first residual sequence generate multiple noise signals and perform classical EMD decomposition to obtain the second modal component of the original capacity sequence.
[0079] ; (4)
[0080] S46: Remove the second modal component from the first residual sequence to obtain the second residual sequence; specifically, remove the second modal component from the first residual sequence to obtain the second residual sequence :
[0081] ; (5)
[0082] S47: Repeatedly extract the modal components of the residual sequence until the remaining residual sequence meets the preset requirements to obtain the intrinsic mode functions of different frequencies. Specifically, repeat the above steps to successively extract the IMF from the residual sequence which represents the modes of different time scales in the sequence. When the remaining residual sequence is a very small monotonic function, stop the decomposition.
[0083] ; (6)
[0084] ; (7)
[0085] The original capacity sequence is decomposed into several IMF components and a residual sequence, as shown in Equation (8).
[0086] ; (8)
[0087] S5: Use the feature factors that meet the preset correlation threshold as the input sequence of the Transformer model, and use the intrinsic mode function as the prediction sequence of the transformer model to train the Transformer model.
[0088] The Transformer model is different from the recurrent neural network (RNN) and the long short-term memory network (LSTM). It relies entirely on the attention mechanism rather than processing the sequence recursively.
[0089] A further implementation is that the Transformer model includes an input block, an encoder, a decoder, and an output block; among them, both the encoder and the decoder include multiple stacked attention layers and feed-forward networks, and the decoder also includes a masked multi-head attention layer to prevent the model from using future values when predicting the next value.
[0090] The structure of the multi-head attention mechanism is as shown in the dashed box in Figure 2 , which is the core of the Transformer and is used to capture the dependencies at different positions in the input sequence. The self-attention mechanism is completed through query (Query), key (Key), and value (Value) vectors. Each element in the input sequence will generate a set of Q, K, V, and then calculate the self-attention output through weighted summation
[0091] ; (9)
[0092] Among them,[[]] is the query matrix,[[]] is the key matrix,[[]] is the value matrix,[[]] is the scaling factor, which is used to alleviate the vanishing gradient and keep the input of the function within a reasonable range.
[0093] Multi-head attention is an extension of the self-attention mechanism. It projects the input data onto multiple subspaces, applies the self-attention mechanism to each subspace, and finally linearly combines the outputs of each subspace using equations (10) and (11).
[0094] ; (10)
[0095] ; (11)
[0096] In equation (10), , , corresponds to , , The weight matrix of. It can be found that the output of each attention layer in the Transformer will pass through a feed-forward neural network (FFN), which consists of two fully connected layers with a ReLU activation function in the middle:
[0097] ; (12)
[0098] In Equation (12), x represents the input vector, that is, the output of the attention layer in the Transformer, W1 represents the weight matrix of the first fully connected layer, W2 represents the weight matrix of the second fully connected layer, b1 represents the bias term of the first fully connected layer, and b2 represents the bias term of the second fully connected layer.
[0099] The Transformer model itself does not have the ability to process information in sequence. Therefore, the positional encoder (PE) provides positional information for each position of the input sequence. The positional encoding is generated using sine and cosine functions of different frequencies, enabling the model to understand the sequential information in the sequence. The PE formula is divided into the even indices of the position and the odd indices of the position, and the specific expressions are shown in Equations (13) and (14):
[0100] ; (13)
[0101] ; (14)
[0102] Among them, is the dimension index in the positional encoding, represents the number of hidden units of the model. The positional encoding calculated in this way can add distinguishable positional information to the input vectors at different positions, which helps the transformer model to understand the sequential relationship in the sequence without relying on the order of the input sequence.
[0103] S6: Improve the sparrow search algorithm by combining the sin chaotic mapping, the adaptive dynamic weight factor, and the reverse learning-Cauchy alternating mutation strategy, and use the improved sparrow search algorithm to optimize the trained Transformer model to obtain a lithium-ion battery state of health estimation model.
[0104] The SSA (Sparrow Search Algorithm) is a newly emerging meta-heuristic swarm intelligence optimization algorithm that achieves global optimization by simulating the behaviors of sparrows such as foraging, early warning, and leadership. However, the original SSA may have drawbacks such as slow convergence speed, poor optimization ability, and premature convergence. To address these issues, this study proposes an improved SSA that combines sin chaotic mapping for population initialization, time-varying weights, and reverse learning-Cauchy alternating mutation multi-strategy fusion.
[0105] A further implementation manner lies in that the method for improving the sparrow search algorithm includes:
[0106] S61: In the basic sparrow algorithm, the population is initialized randomly. If the initialization is too concentrated or localized, the algorithm is likely to fall into a local optimum. In this invention, the population of the sparrow search algorithm is initialized based on the sin chaotic mapping with an infinite number of mapping folding times to obtain the position of the population individuals after mapping;
[0107] A further implementation manner lies in that the method for obtaining the position of the population individuals after mapping includes:
[0108] Based on the sin chaotic mapping with an infinite number of mapping folding times, a chaotic sequence is generated:
[0109] ; (15)
[0110] The generated chaotic sequence is linearly mapped to the search space:
[0111] ; (16)
[0112] Among them, the formula (15) is used to iteratively generate chaotic values, and then the generated series of chaotic values are linearly mapped to the search space through formula (16), is the chaotic sequence, x n is a variable in the sin chaotic mapping, representing the nth value in the chaotic sequence, and are respectively the lower and upper limits of the search variable, is the th value of the chaotic sequence, is the position of the population individuals after mapping.
[0113] S62: Based on a preset fitness function, the population individuals are divided into discoverers and followers; among them, the discoverers are used to explore the location of the global optimal solution, and the followers are used to perform local search around the discoverers.
[0114] S63: In order to better balance the relationship between exploration and exploitation, an adaptive dynamic weight factor is introduced to update the positions of the discoverers and followers to obtain the current global optimal solution.
[0115] In a further embodiment, an adaptive dynamic weight factor is introduced, and the method for updating the positions of the discoverers and followers includes:
[0116] Based on the adaptive dynamic weight factor and the global optimal solution generated during the position update iteration process, the position of the discoverer is updated, and the update formula is as follows:
[0117] ; (17)
[0118] ; (18)
[0119] In the formula, represents the position of the th discoverer individual in the -dimensional space at the th iteration; represents the global optimal solution in the th iteration; is a random number obeying the normal distribution in [0, 1], F is the warning value, S is the safety value; rand is a random generation function used to generate random numbers; is the adaptive dynamic weight factor; represents the maximum number of iterations; as shown in formula (17), in the discoverer individual position update formula, the global optimal solution from the previous iteration is added. When the warning value F is less than the safety value S, a wide search is carried out; when the warning value F is greater than the safety value S, a transfer is made as soon as possible to avoid falling into a local optimum. At the same time, a time-varying weight coefficient is introduced, which is beneficial to expanding the search range in the early stage of iteration and performing precise development in the later stage of iteration, thus accelerating the convergence speed.
[0120] Based on the position of the discoverer and the current globally worst individual, the position of the follower is updated, and the update formula is as follows:
[0121] ; (19)
[0122] In the formula, represents the current globally worst individual; is the position of the th discoverer; is used to adjust the displacement direction; is the matrix, and each element in the matrix is 1, and M is the total number of individuals in the sparrow search algorithm.
[0123] S64: Perturb the current global optimal solution based on the opposition-based learning-Cauchy alternating mutation strategy to obtain a new solution. In this embodiment, the core idea of opposition-based learning is to simultaneously consider the current solution and its opposite solution based on symmetry, expand the search space, effectively avoid local optimal traps, and finally select the optimal solution by comparing the two. The mathematical expressions are shown in Eqs. (20)-(22):
[0124] ; (20)
[0125] ; (21)
[0126] ; (22)
[0127] wherein, denotes element-wise multiplication (Hadamard product), that is, the corresponding elements of two vectors are multiplied.
[0128] The position of the current optimal solution relative to the lower bound is inversely mapped, and a random number matrix is added to balance the learning process, denotes the upper bound, ensuring that the opposite solution is within a reasonable solution space. Taking the opposite solution as a reference, calculate the gap between the current optimal solution and the opposite solution, and use the information exchange control perturbation to scale and then superimpose it on the opposite solution to generate a new solution .
[0129] The standard SSA is prone to falling into local optimum during the local exploitation process. As a method based on the Cauchy distribution, the CM strategy has a higher probability of generating large-scale mutations by introducing large-step random perturbations, enabling individuals to perform large-scale searches and break away from local optimal solutions. The Cauchy distribution exhibits zero symmetry, and the generated mutation directions can be positive or negative, ensuring the diversity of search directions.
[0130] ; (23)
[0131] Randomly obtain a number from the standard Cauchy distribution and act on the current optimal solution to generate a new solution . Based on the long-tailed characteristics of the Cauchy distribution, this new solution may be far from the optimal solution, further enhancing the global search ability.
[0132] Opposite learning and Cauchy mutation dynamically update the target position under specific strategies: The opposite learning strategy focuses on expanding the search range and avoiding being confined to a narrow area; while Cauchy mutation breaks through the local optimal solution through large-scale mutation. Alternating execution of the two can better balance local exploitation and global exploration.
[0133] ; (24)
[0134] In the initial stage, due to the large value of the exponential term, the dynamic adjustment factor may be closer to a relatively small number, thus promoting the global search of the algorithm. In the later stage of the algorithm, as the number of iterations increases, the influence of the exponential term gradually decreases, and the dynamic adjustment factor gradually approaches the constant term , thus gradually transitioning to local search. By controlling the exponential function, a smooth transition from global search to local search can be achieved, avoiding premature convergence too quickly. Among them, is a dynamic adjustment parameter used to balance the global exploration and local exploitation capabilities of the algorithm.
[0135] S65: Based on the elite principle, compare the fitness values of the new solution and the position of the current global optimal solution, and based on the fitness value, determine whether to update the position where the current global optimal solution is located. The formula is as follows:
[0136] ; (25)
[0137] A further implementation manner lies in using the improved sparrow search algorithm to optimize the trained Transformer model, including optimizing the number of attention mechanism heads, the initial learning rate, and the L2 regularization coefficient of the Transformer model.
[0138] The specific steps of using the improved sparrow algorithm to optimize the Transformer model include:
[0139] 1) The number of heads in the multi-head attention mechanism in Transformer, the initial learning rate and the L2 regularization coefficient are very important for improving the model performance. The present invention uses ISSA to automatically optimize the hyperparameters , and , and the specific implementation steps are as follows:
[0140] 2) Define the expression of the fitness function, and use the formula (15) sine chaotic mapping to initialize the population. During the initialization process, it is necessary to conform to the reasonable range of hyperparameters.
[0141] 3) Calculate the fitness value of each individual, select a part of the individuals as "discoverers" according to the fitness value of the current individual, and update the position according to Equation (17), which is responsible for exploring the area where the global optimal solution is located. The remaining sparrow individuals act as "followers" and update their positions according to Equation (19), mainly responsible for local search around the discoverers.
[0142] 4) Dynamically select the reverse learning strategy and Cauchy mutation to perturb the global optimal solution according to Equation (24): If , use Cauchy mutation to perturb when updating the individual position, increasing randomness and avoiding falling into local optima; if , generate reverse solutions for the current generation of individuals to make the search space more comprehensive.
[0143] 5) Judge whether to update the position and fitness value where the global optimal solution is located according to the elitist principle of Equation (25).
[0144] 6) Judge whether the maximum number of iterations is reached : If so, assign the optimal hyperparameter combination to the transformer model; otherwise, go back to step 2) and continue to execute.
[0145] S7: Based on the lithium-ion battery state of health estimation model, estimate the state of health of the lithium-ion battery to be estimated, and obtain the estimated value of the lithium-ion battery state of health.
[0146] In this embodiment, the overall process of the CEEMDAN-ISSA-Transformer algorithm is as Figure 3 shown: First, analyze the basic structure and working characteristics of the lithium-ion battery and select the aging dataset, and perform feature extraction and outlier processing on the aging process. Then, perform Pearson correlation coefficient analysis between the three extracted feature factors and the original capacity. During the process of battery capacity degradation, there are different degrees of capacity regeneration phenomena, which will affect the estimation accuracy of the transformer prediction model. Use CEEMDAN to perform modal decomposition on the original capacity sequence. The finite number of IMFs decomposed correspond to the low, medium, and high frequency components of the battery signal, enhancing the recognition effect of the prediction model on the feature factors and removing the high-frequency noise in the data at the same time. The feature factors are divided into a 60% training set and a 40% test set as the input sequence of the model, and the IMFs are divided in the same proportion as the prediction columns of the model. Use the improved sparrow optimizer to automatically optimize the number of attention mechanism heads , the initial learning rate and the L2 regularization coefficient in the prediction model, and finally combine the outputs of the model to obtain the SOH prediction value.
[0147] Embodiment 2
[0148] The present invention also provides a lithium battery state of health estimation system based on Transformer for implementing the method, including:
[0149] A dataset construction module for establishing an aging dataset of lithium-ion batteries based on the basic structure and working characteristics of lithium-ion batteries;
[0150] A feature extraction module for performing outlier processing and feature extraction on the aging dataset of lithium-ion batteries to obtain feature factors;
[0151] A correlation calculation module for calculating the correlation between the feature factors and the original capacity sequence of the lithium-ion battery to obtain feature factors that meet the preset correlation threshold;
[0152] A modal decomposition module for decomposing the original capacity sequence based on the complete ensemble empirical mode decomposition with adaptive noise algorithm to obtain intrinsic mode functions of different frequencies;
[0153] A model training module for using the feature factors that meet the preset correlation threshold as the input sequence of the Transformer model and the intrinsic mode functions as the prediction sequence of the transformer model to train the Transformer model;
[0154] A sparrow algorithm improvement module for improving the sparrow search algorithm by combining the sine chaotic mapping, adaptive dynamic weight factor, and reverse learning-Cauchy alternating mutation strategy, and using the improved sparrow search algorithm to optimize the trained Transformer model to obtain a lithium battery state of health estimation model;
[0155] An estimation module for estimating the state of health of the lithium battery to be estimated based on the lithium battery state of health estimation model to obtain a lithium battery state of health estimation value.
[0156] Embodiment III
[0157] This embodiment provides an experimental process of the lithium battery state of health estimation method based on Transformer.
[0158] Data source: In this embodiment, two battery aging experiment datasets are used, which come from the Center for Advanced Life Cycle Engineering (CALCE) of the University of Maryland and the NASA Ames Research Center respectively. The specific models of the 7 selected batteries are CS2_33, CS2_35, CS2_36, CS2_37 in the CALCE dataset, and B0005, B0006, and B0007 in the NASA dataset. Table 1 shows the basic parameter specifications of the two types of batteries. The specific steps of the aging experiment are as follows: The CS2 series batteries are charged at a constant current (CC) of 0.5C until the voltage reaches the charging cut-off voltage of 4.2V, then switched to constant voltage (CV) charging until the charging current drops to 20mA, and then discharged in the CC mode to the cut-off voltage of 2.7V. When the rated capacity of the battery drops to 0.77Ahr, the cycle experiment is terminated. The NASA batteries also use the CC-CV-CC charge-discharge mode for aging experiments at a room temperature of 24 degrees. The discharge cut-off voltages of B0005, B0006, and B0007 are 2.7V, 2.5V, and 2.2V respectively. When the rated capacity of the battery drops to 30% of it, that is, 1.4Ahr, the cycle experiment is terminated.
[0159] Table 1
[0160] Battery parameters CALCE_CS2 Design efficiency 1.1 Ahr Rated voltage 3.7V Cathode material <![CDATA[LiCoO2]]> Scale 5.4 * 33.6 * 50.6 mm
[0161] Figure 4 This is the curve of the capacity of the CS2_35 battery in the embodiment of the present invention changing with the number of cycles (CN). Generally speaking, the capacity of the battery shows a slow decay trend as the number of cycles increases. When the battery capacity decays to 70% of the initial capacity, it becomes the "end of life (EOL)". Locally, there is a phenomenon of short-term capacity regeneration during the decline of the battery capacity. This volatility increases the difficulty of subsequent SOH estimation and also affects the estimation accuracy.
[0162] Health indicator extraction (characteristic factors): A complete cycle experiment includes three main stages: constant current charging stage (CCCP), constant voltage charging stage (CVCP), and constant current discharge stage (CCDP). In order to analyze the changing trend of current and voltage of lithium-ion batteries during aging in detail, the voltage-current change curves of the CS2_35 battery in a complete CC-CV-CC charge-discharge mode in the initial cycle stage are selected and plotted as Figure 5 shown in (a) and (b) below. The aging process of the battery is closely related to these three stages.
[0163] Figure 6In (a), (b), and (c), the variations of HI1 - HI3 of the CS2_35 battery with battery aging are shown respectively. As the number of cycles increases, the available capacity gradually declines, and there is a positive correlation between the constant voltage charge time (CVCT) and the number of cycles; with the further decline of the battery capacity, the charge amount accepted in CCCP decreases, the voltage rises faster, and the CC - CV conversion point is reached earlier, and there is a negative correlation between the constant current charge time (CCCT) and the number of cycles; during the cyclic use of the battery, the capacity attenuation and the increase in Re are interrelated, and a feedback loop is formed between the two. Therefore, finally, CVCT, CCCT, and Re are used as health index 1 (HI1), health index 2 (HI2), and health index 3 (HI3) respectively.
[0164] To further verify the correlation between the health indicators extracted from each dataset and the capacity degradation, Table 2 lists the pearson correlation coefficients between HI1 - HI3 of the 7 - battery aging datasets and the original capacity. As can be seen from Table 2, the absolute values of the pearson coefficients corresponding to HI1 and HI3 are both greater than 0.8, indicating a strong negative correlation between HI1 and HI3 and the capacity attenuation; the pearson coefficient of HI2 is greater than 0.95, indicating a high positive correlation between HI2 and the capacity attenuation.
[0165] Table 2
[0166] Battery parameters HI1 HI2 HI3 CS2_35 -0.865 0.987 -0.857
[0167] CEEMDAN modal decomposition: Take the extracted health characteristic factors HI1 - HI3 as the input sequence of the prediction model, and use the CEEMDAN technique to decompose the capacity degradation curve during the battery aging process. Different from VMD which requires customizing the number of IMFs after decomposition, CEEMDAN can effectively decompose the original signal by only determining three parameters: the noise standard deviation, the resampling number, and the maximum number of iterations. The noise standard deviation is used to control the intensity of the noise, usually selected as the ratio of the standard deviation of white noise to the amplitude standard deviation of the original signal. The noise resampling number usually ranges from 100 to 500. Considering the complexity of the original signal, in order to ensure a more robust decomposition effect without significantly increasing the computational amount, the noise resampling numbers for the original capacity signals of the CS2 series and NASA system batteries are set to 300 and 200 respectively. The maximum number of iterations is used to control the convergence of the decomposition. Initially set to 200 and analyze whether there is modal aliasing in the decomposed IMFs. After multiple experimental debuggings, under the condition of limited computing resources, reduce the maximum number of iterations to reduce the computational overhead and balance the accuracy and efficiency. Finally, the maximum number of iterations is set to 100.
[0168] Figure 7(a)-(h) show the decomposition results of the original capacity signal of the CS2_35 battery. The capacity degradation curve is decomposed into 8 IMFs. Generally speaking, as the decomposition level increases, the frequencies of IMF1 to IMF8 gradually decrease. At the same time, IMF1 to IMF7 can effectively capture the local short-term capacity regeneration changes existing in the original signal, while IMF8 reflects the overall degradation trend of the capacity during the aging process. High-frequency IMFs usually contain noise signals brought by capacity regeneration, and medium- and low-frequency IMFs more reflect the actual capacity degradation trend. By screening and removing high-frequency IMFs, the influence of short-term fluctuations in capacity regeneration is removed, and an effective capacity curve reflecting the long-term degradation of the battery is obtained.
[0169] Commonly used algorithm evaluation indicators include: mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error. In this study, the input sequence of the model is divided into a training set and a test set. For the selection of the objective function, if only RMSE is used as the objective function on the training set, the model may overfit. In the prediction of the state of health (SOH) of lithium-ion batteries, more attention is paid to the performance of the model on unseen data. RMSE sums the squares of the errors, which can significantly amplify the large deviation between the predicted value and the true value and is highly sensitive to major errors of the model. Therefore, finally, the RMSE of the test set is selected as the objective function of the algorithm. Compared with other metrics such as MAE, RMSE pays more attention to the square of the error, can increase the penalty for extreme values, and at the same time avoids the model being optimized only for the training set, promoting the generality of the model.
[0170] SOH estimation based on the CEEMDAN-ISSA-Transformer model: Before the health indicator sequence is input into the model, 60% of the dataset is used as the training set, and the remaining 40% is used to test the model. Figure 8 The prediction results are compared with the SOH reference values. All four models can effectively track the overall trend of capacity degradation during battery aging. Compared with the single Transformer model, the introduction of CEEMDAN significantly reduces the noise interference of capacity regeneration on SOH prediction. Compared with the CEEMDAN-Transformer model, the added SSA optimization algorithm enables the model to adaptively find the optimal combination of hyperparameters, thereby improving the learning efficiency. The multi-strategy improved SSA algorithm balances the global search and local development capabilities and reduces the risk of falling into local optimal solutions. Therefore, the model proposed in the present invention can more accurately predict the SOH of the battery, and its RMSE, MAE, and MAPE do not exceed 0.009820, 0.008545, and 1.367037% respectively, and the R² value is greater than 0.9609.
[0171] Accurately and real - time estimating the state of health (SOH) of lithium - ion batteries is crucial for the normal operation of energy storage systems, especially in the context of the increasing popularity of renewable energy and electric transportation. This invention proposes a CEEMDAN - ISSA - Transformer model for lithium - ion battery SOH estimation, aiming to improve the efficiency and safety of energy storage systems. First, battery health characteristic indicators are extracted from the original capacity degradation data and used as the input sequence for the subsequent prediction model. Then, the CEEMDAN decomposition method is used to decompose the original capacity information into intrinsic mode functions (IMFs) at different frequencies, effectively capturing the non - linear capacity regeneration phenomenon during battery aging. By removing the high - frequency IMFs containing capacity regeneration noise, the mid - low - frequency IMFs are used as the prediction subsequence of the model and input into the ISSA - Transformer prediction model. Finally, the output subsequences of the model are superimposed and combined to obtain the final SOH prediction value.
[0172] In summary, the technical effects of this invention include the following aspects:
[0173] 1. Using CEEMDAN decomposition and removing the high - frequency IMFs containing capacity regeneration noise, thus ensuring that the feature sequence input into the model is cleaner. This noise removal mechanism improves the prediction accuracy of the model, reduces the errors caused by noise, and effectively reduces the time complexity of the algorithm while maintaining the same space complexity, enhancing the convergence and robustness of the model.
[0174] 2. Using the sine chaotic map to replace the random initialization of the population, reducing the risk of the algorithm falling into local optimal solutions. Introducing a time - varying weight factor into the individual position update formula to expand the search range and achieve local precise development. The reverse learning - Cauchy mutation alternating mutation strategy balances the global exploration and local development capabilities, and uses the multi - strategy - fused SSA to optimize the parameter settings of the Transformer model, improving the model learning efficiency, enabling it to adaptively find the optimal hyperparameter combination, and enhancing the accuracy and stability of prediction.
[0175] 3. Comparing the prediction results of this invention with newly published algorithms in recent years, verifying the innovation and superiority of the model, especially its performance in complex energy storage application scenarios.
[0176] 4. By reducing the proportion of training set data, the robustness and stability of the proposed algorithm are tested to ensure its wide applicability in actual energy storage systems.
[0177] The embodiments described above are only descriptions of the preferred embodiments of the present invention and do not limit the scope of the present invention. Without departing from the design spirit of the present invention, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention shall fall within the protection scope determined by the claims of the present invention.
Claims
1. A lithium battery health status estimation method based on Transformer, characterized in that: The method comprises: Based on the basic structure and working characteristics of lithium-ion batteries, a lithium-ion battery aging data set is established; Performing outlier processing and feature extraction on the lithium-ion battery aging data set to obtain characteristic factors; Calculating the correlation between the characteristic factor and the original capacity sequence of the lithium-ion battery to obtain the characteristic factor that meets a preset correlation threshold; Decomposing the original capacity sequence based on a fully adaptive noise set empirical mode decomposition algorithm to obtain intrinsic mode functions of different frequencies; Taking the characteristic factors that meet the preset correlation threshold as the input sequence of the Transformer model, taking the intrinsic mode function as the prediction sequence of the Transformer model, and training the Transformer model; The sparrow search algorithm is improved by combining sin chaotic mapping, adaptive dynamic weight factor and reverse learning-Cauchy alternating mutation strategy, and the trained Transformer model is optimized by the improved sparrow search algorithm to obtain the health state estimation model of lithium-ion batteries. Based on the lithium-ion battery health state estimation model, the health state of the lithium-ion battery to be estimated is estimated to obtain a lithium-ion battery health state estimation value.
2. The method for estimating the health status of a lithium battery based on Transformer according to claim 1, characterized in that: Methods for obtaining eigenmode functions of different frequencies include: Add white noise to the original capacity sequence to obtain the noisy capacity sequence; Performing empirical mode decomposition on the noisy capacity sequence to obtain a first intrinsic mode function; The first intrinsic mode function is averaged to obtain the first mode component of the original capacity sequence after fully adaptive noise ensemble empirical mode decomposition; Remove the first modal component in the original capacity sequence to obtain the first residual sequence; Adding new white noise to the first residual sequence to obtain a noisy residual sequence; Performing empirical mode decomposition on the noisy residual sequence to obtain a second mode component of the original capacity sequence; Removing the second modal component from the first residual sequence to obtain a second residual sequence; The modal components of the residual sequence are extracted repeatedly until the remaining residual sequence meets the preset requirements, and the intrinsic mode functions of different frequencies are obtained.
3. The method for estimating the health status of a lithium battery based on Transformer according to claim 1, characterized in that: The Transformer model includes an input block, an encoder, a decoder and an output block; wherein the encoder and the decoder both include multiple stacked attention layers and feedforward networks, and the decoder also includes a masked multi-head attention layer.
4. The method for estimating the health status of a lithium battery based on Transformer according to claim 1, characterized in that: Methods to improve the sparrow search algorithm include: The population of the sparrow search algorithm is initialized based on the sin chaotic map with infinite mapping folding times, and the individual positions of the population after mapping are obtained; Based on the preset fitness function, the population individuals are divided into discoverers and followers; the discoverer is used to explore the location of the global optimal solution, and the follower is used to perform local search around the discoverer; Introduce an adaptive dynamic weight factor to update the positions of discoverers and followers to obtain the current global optimal solution; Based on the reverse learning-Cauchy alternating mutation strategy, the current global optimal solution is disturbed to obtain a new solution; Based on the elitist principle, the fitness values of the new solution and the position of the current global optimal solution are compared, and based on the fitness values, it is determined whether to update the position of the current global optimal solution.
5. The method for estimating the health status of a lithium battery based on Transformer according to claim 4, characterized in that: Methods for obtaining the individual positions of the population after mapping include: Generate a chaotic sequence based on the sin chaotic map with infinite mapping folding times: , Linearly map the generated chaotic sequence to the search space: , in, is a chaotic sequence, x n is a variable in the sin chaotic map, representing the nth value in the chaotic sequence. and are the lower and upper bounds of the search variable, The chaotic sequence values, is the individual position of the population after mapping.
6. The method for estimating the health status of a lithium battery based on Transformer according to claim 4, characterized in that: Methods for introducing adaptive dynamic weight factors and updating the positions of discoverers and followers include: Based on the adaptive dynamic weight factor and the global optimal solution generated in the iterative process of position update, the discoverer position is updated. The update formula is as follows: In the formula, Indicated in In the iteration The discoverer individual The location of the dimension; Indicates The global optimal solution in the iteration; is a random number that follows the normal distribution of [0,1], F is the warning value, S is the safety value; rand is a random generation function used to generate random numbers; is the adaptive dynamic weight factor; Indicates the maximum number of iterations; Based on the discoverer's position and the current global worst individual, the follower's position is updated. The update formula is as follows: , In the formula, Represents the current global worst individual; It is the location of the discoverer; Used to adjust the displacement direction; for A matrix in which each element is 1, and M is the total number of individuals in the sparrow search algorithm.
7. The method for estimating the health status of a lithium battery based on Transformer according to claim 4, characterized in that: Using the improved sparrow search algorithm to optimize the trained Transformer model includes optimizing the number of attention mechanism heads, initial learning rate, and L2 regularization coefficient of the Transformer model.
Citation Information
Patent Citations
Lithium ion battery state-of-health prediction method based on ISSA coupled DELM
CN113884936A
Lithium ion battery health state estimation method based on feature optimization
CN119575194A