A Lithium-ion Battery Health State Estimation Method Based on Adaptive Transfer Learning
By employing an adaptive transfer-based lithium battery state of health estimation method, which combines a Transformer model and an adaptive module, the problem of adaptive prediction of lithium battery state of health (SOH) under different operating conditions is solved, achieving high-precision and low-cost SOH estimation.
Patent Information
- Application Number
- CN202410585934.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-05-13
AI Technical Summary
Existing lithium battery health state estimation methods lack adaptability under different operating conditions, cannot effectively predict battery SOH under various operating conditions, and suffer from domain shift and poor model generalization.
An adaptive transfer-based lithium battery health state estimation method is adopted. By combining the Transformer model with an adaptive module and a multi-head attention mechanism, an adaptive fusion strategy is designed. Health indicators are extracted through interpolation and difference methods, and a SOH sub-estimator is integrated on the basis of predicted loss weighting to achieve adaptive estimation for different operating conditions.
It improves the accuracy and generalization ability of SOH estimation for lithium batteries, enabling effective prediction of battery health status under different operating conditions and reducing model training time and cost.
Smart Images

Figure CN118503924B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lithium battery technology, and in particular to a method for estimating the state of health of lithium batteries based on adaptive migration. Background Technology
[0002] Against the backdrop of rapid development in industries such as electric vehicles, consumer electronics, and new energy storage, lithium batteries' comprehensive advantages align with the increasing demands of downstream sectors for large capacity, high power, long lifespan, and environmental protection, presenting a broad market application prospect. Due to their significant advantages such as high energy density, high discharge power, long cycle life, no memory effect, and environmental friendliness, lithium batteries play an indispensable role in fields such as road transportation and aerospace. In general, lithium batteries have occupied a crucial position in today's society and have become an important energy source in many fields. However, lithium batteries degrade over time, leading to capacity reduction, increased internal resistance, and potentially even safety hazards. Therefore, SOH estimation technology is crucial for battery management systems to improve battery performance and safety.
[0003] State of Health (SOH) estimation for lithium batteries is the process of assessing and predicting the battery's storage capacity, charge / discharge capacity, and aging degree. This is crucial for battery performance optimization, safe use, and extended lifespan. SOH estimation methods are divided into direct measurement methods and indirect measurement methods. Direct measurement methods use measured data such as internal resistance, stacking stress, and open-circuit voltage to directly calculate the battery's SOH. While direct measurement methods are simple and intuitive, they require specialized testing equipment and are affected by testing conditions and environmental factors.
[0004] Indirect measurement methods can be further divided into model-based methods and data-driven methods. Model-based methods require the establishment of models that describe the internal chemical reactions and physical processes of lithium batteries, such as electrochemical models, equivalent circuit models, and particle filters. However, model-based methods are greatly affected by factors such as manufacturing processes and material properties, have low robustness, and require a large amount of prior knowledge, resulting in high model complexity and modeling costs. Data-driven methods extract health indicators (HIs) related to battery SOH from a large amount of experimental or actual operating data, and then use machine learning to build and train models to achieve SOH estimation. Among these, deep neural networks are used most frequently, especially recurrent neural networks (RNNs) and their variants. This is because battery SOH prediction is based on regression algorithms using time-series data, and other traditional machine learning methods cannot extract time-dependent information from battery data. For example, Ardeshiri et al. proposed a deep learning method based on stacked bidirectional long short-term memory networks to predict the capacity degradation trajectory and RUL of lithium batteries. Although these data-driven methods have made significant progress in improving the accuracy of SOH estimation, some problems still need to be solved. First, these methods assume that the target battery has sufficient degradation data to train the model and learn the degradation trajectory. However, in practical applications, monitoring data is typically collected from operating batteries and models are used to estimate future state of equilibrium (SOH). This data is not complete data from cycle to failure, which can cause the constructed model to fail to learn the degradation state close to battery failure. Secondly, the distribution of battery degradation data is easily affected by charging strategies, temperature, and other operating conditions, resulting in different distributions. This may lead to domain shift and increased prediction error when applying models trained with battery data from different operating conditions.
[0005] To address the aforementioned issues and further improve prediction accuracy and generalization, an increasing number of scholars are combining transfer learning methods with data-driven approaches. This involves transferring degradation knowledge learned on one battery dataset to another, avoiding performance degradation caused by a lack of labeled data and domain shift. Extensive research has shown that these methods effectively improve the estimation accuracy of lithium-ion battery state of health (SOH), demonstrating significant application value and research significance. For example, Yao et al. constructed a deep transfer convolutional neural network that uses partial charge-discharge data to estimate battery capacity, eliminating data distribution differences between different batteries and thus improving prediction accuracy. However, current transfer learning-based SOH estimation methods all transfer models trained on battery data under a fixed operating condition to batteries under another single operating condition, failing to adaptively predict SOH under multiple operating conditions. In practice, the operating conditions of lithium-ion batteries are constantly changing due to factors such as charging strategies, operating environment, and actual stress. To address this issue, this patent proposes an adaptive transfer-based lithium-ion battery state of health estimation method, solving the SOH problem of lithium-ion batteries under different operating conditions. Summary of the Invention
[0006] To address the problems existing in the prior art, this invention aims to provide a lithium battery health state estimation method based on adaptive transfer. It analyzes the data distribution of lithium batteries with different fast charging strategies during the charging process and rationally selects the current and discharge capacity during the constant voltage charging stage to characterize the capacity degradation state. A new health index is designed using interpolation and difference methods, and Pearson correlation coefficient analysis shows a high correlation with discharge capacity. An advanced adaptive module for learning the degradation characteristics of lithium batteries under different operating conditions is designed. In the second stage of model optimization, multiple target data are used to fine-tune only the network parameters of their corresponding adaptive modules without affecting the parameters of other modules, avoiding the catastrophic forgetting problem caused by full fine-tuning. An adaptive fusion strategy based on a multi-head attention mechanism is proposed to fuse the outputs of all adaptive modules. This strategy connects the adaptive modules to facilitate model training, and the attention-weighted fusion of different battery degradation characteristics is beneficial for learning the capacity degradation trajectory. In the SOH estimator, a weighting method based on prediction loss is developed to integrate the outputs of all sub-estimators to obtain the SOH estimate. This method uses the current period's true SOH value to calculate the prediction loss during the training phase with labeled data, and uses the estimation error from the previous period during the testing phase with unlabeled data. This further enhances the model's transfer learning ability on target data with few samples and improves the accuracy of prediction.
[0007] To solve the above problems, the present invention adopts the following technical solution.
[0008] A method for estimating the state of health of a lithium battery based on adaptive migration includes the following steps:
[0009] Step 1). Given a complete existing battery degradation dataset from cycle to failure and partial degradation data of the battery under unknown operating conditions to be predicted online;
[0010] Step 2). Integrate the health indicators that are highly correlated with SOH during the constant voltage charging stage and preprocess the integrated data using a sliding time window technique and a normalization method;
[0011] Step 3). Using Transformer as the main body, an adaptive module is added to extract advanced degradation features of batteries under different operating conditions. An adaptive fusion strategy with multi-head attention mechanism effectively combines the outputs of all adaptive modules.
[0012] Step 4). Based on the predicted loss, weight and integrate the outputs of all SOH sub-estimators as the final SOH estimate, and then optimize and train the model.
[0013] Step 5). When fine-tuning the model parameters, adjust the adaptive module and SOH estimator in the model, and freeze the rest to achieve SOH estimation.
[0014] In step 1), a complete degradation dataset of a battery cycled to failure is given, along with partial degradation data of the battery under unknown operating conditions to be predicted online, as shown in equations (1) and (2):
[0015]
[0016]
[0017] Among them, B S Represents a complete source domain degradation data sample, n s Indicates the number of samples in the source domain. and Let B represent the degraded data of the i-th sample in the source domain and its corresponding capacity label, respectively. T This represents the collection of degraded data in the target domain. and Let represent the data samples and their quantity in the p-th target domain, and M represent the number of different unknown operating conditions of the SOH battery to be predicted online. and Let represent the degraded data of the j-th sample in the p-th target domain and its corresponding capacity label, respectively.
[0018] Step 2) preprocesses the data from step (1) using a sliding time window technique and a max-min normalization method. The sliding time window technique is used to convert degraded data into a time series input, with an input time window size of N. tw The time step is t d The input data at the i-th time step can be represented as:
[0019]
[0020] in, This indicates selecting data from row i to row (i+N). tw -t d The row data is used as the input data for the i-th time step, x i,s Let represent the s-th data item of the i-th data sample. Then, normalization is performed on the data, calculated using the following formula:
[0021]
[0022] in, Max(x) represents the j-th reading of the k-th selected sensor in the data sample. k min(x) k) represent the maximum and minimum values among the readings of the k-th selected sensor, respectively. for Normalized data sample.
[0023] In step 3), the processed data is input into a Transformer with an adaptive module, abbreviated as TLAFM, whose structure includes an encoder and a decoder. The encoder encodes the input health indicators into a vector sequence with time dependencies, and the decoder decodes the vector sequence into a tensor representing capacity degradation.
[0024] Positional encoding: In Transformer, a positional encoding mechanism is introduced to encode the temporal information of the input sequence into the representation of each time step. Therefore, the temporal dependencies of the input sequence can be preserved by performing the following calculation on the data processed in step (2):
[0025]
[0026] Where PE represents an unknown encoding operation, pos represents the position of a data item in a data record, the position encoding of each data item is a vector, i represents the index of each element in this vector, and d input Indicates the dimension of the input data; PE(x) i ) is for data x i The result after position encoding, Z i This represents the final result after residual connection.
[0027] The encoder consists of multiple identical encoder layers, each layer comprising two parts: a multi-head self-attention mechanism (MultiHeadAttention) and a position-level feedforward network (FFN). Both parts have a residual connection and a layer normalization (LayerNorm) signal, which is transmitted via the position-encoded Z-axis. i The data is input into the encoder and passes through multiple encoder layers to obtain a vector sequence Vec containing time information. The calculation process of the data flowing to the p-th encoder layer is as follows:
[0028]
[0029] Where Q, K, and V are computational vectors with the same dimension as the input data in the multi-head attention mechanism, used to capture dependencies and dynamically allocate weights; concat represents the vector concatenation operation; head en,h W represents the data of the h-th head. en,p , and The weights represent learnable parameters; Attention represents the attention mechanism; softmax is an activation function; d kIndicates the input data dimension for each head; en_h1 represents the result after residual connection, en_h2 represents the output of the position-level feedforward network, W en,1 W en,2 and b en,1 b en,2 These represent the learnable weights and biases, respectively; Vec p and Vec p-1 This represents the output of the p-th encoder and the encoder preceding it.
[0030] The decoder consists of multiple decoder layers, the same number as the encoder. Each layer contains three parts: a MaskedMultiHead self-attention mechanism, a multi-head contextual attention mechanism, and a position-level forward propagation network (FFN). Like the encoder, these three parts have a residual connection followed by a normalization layer. The decoder's input is the encoder's output. Furthermore, the second part of the decoder, the multi-head contextual attention mechanism, has two inputs: the output of the previous part and the encoder's output. Therefore, the output of the q-th decoder can be calculated as follows:
[0031]
[0032] Where Q, K, and V are computational vectors with the same dimension as the input data in the multi-head attention mechanism, used to capture dependencies and dynamically allocate weights; concat represents the vector concatenation operation; mask is a matrix of 0s and 1s with the same length as the input sequence, used to control the model to ignore invalid or padded parts when processing sequence data; head de,h W represents the data of the h-th head. de,p , and Represents learnable weight parameters; MaskedAttenuates represents the masked attention mechanism; softmax is an activation function; d k This represents the input data dimension for each head; de_h1 and de_h3 represent the results after the residual connections, and de_h3 represents the output of the position-level feedforward network. W de,1 W de,2 and b de,1 b de,2 Represent the learnable weights and biases, respectively; Out q and Out q-1 This represents the output of the q-th encoder and its preceding decoder.
[0033] The adaptive module is a lightweight incremental structure designed for online prediction of specific target batteries. It takes battery data under unknown operating conditions as input and adapts it to the pre-trained Transformer model by adding a small number of parameters, quickly adapting to new battery data under unknown operating conditions, thereby reducing retraining time and cost. For each Transformer layer, two adaptive modules are added, located after the forward propagation layers in the encoder and decoder, respectively. Each adaptive module includes two feedforward sub-layers. The first feedforward sub-layer takes the output of the Transformer's forward propagation layer as input, and converts the original input dimension d... input Projected to low dimension d m By controlling d m The size of d is used to limit the number of parameters in the adaptive module, where d input >>d m The module is implemented through a non-linear layer using the GELU activation function, as shown in the following formula.
[0034]
[0035] Here, x represents the input feature of the activation function, and tanh is an activation function.
[0036] In the output phase, the module restores the input dimension through a second feedforward sub-layer, converting d... m Remapping back to d input The input of the adaptive module is used as the module's output. Simultaneously, a residual connection is used to add the input of the adaptive module to the final output. Even though the adaptive module's initial parameters are close to 0, the effectiveness of training is ensured through an approximate identity mapping, as shown below:
[0037] h ad ←h ad +GELU(h ad W ad,1 W ad,2 (9)
[0038] Among them, h ad W represents the hidden feature output by the adaptive module. ad,1 and W ad,2 This represents the learnable weight parameters in the adaptive module.
[0039] The adaptive fusion strategy of the multi-head attention mechanism is as follows: The attention score of each adaptive module with the input battery data is calculated. Then, the attention scores are normalized using the softmax function to obtain the attention weights. Finally, the attention weights are weighted and summed with the outputs of all adaptive modules to obtain the fused feature representation. The calculation formula is as follows:
[0040]
[0041] Among them, h n F represents the output of the nth battery data after passing through the position-level forward propagation layer. n Represents the hidden feature h n The output W obtained by inputting into the nth adaptive module n,1 and W n,2 This represents the learnable weight parameters; data from each battery needs to be passed to the corresponding adaptive module, where all adaptive features are concatenated and their weights are calculated using a multi-head attention mechanism. `concat` represents the concatenation operation. and These represent the results after concatenating the output and input data of the adaptive module, respectively; F represents the feature representation after fusion via a multi-head attention mechanism, and W... f and b f This represents the learnable weights and biases.
[0042] Step 4) inputs the result decoded by the Transformer into the SOH estimator. For example... Figure 1 As shown in (f), the SOH estimator consists of three parts. The first part is a random deactivation layer and a dense layer, which receive the output of the last decoder and reduce the risk of overfitting. The second part consists of M sub-estimators that can generate M SOH estimates simultaneously. Each sub-estimator includes a linear layer and two activation function layers. The Tanh activation function layer is located before the linear layer and mainly learns the complex nonlinear functional relationship between features and labels. The Sigmoid activation function layer is located at the top and is used to map the output to a value between 0 and 1. The third part assigns weights to the M values based on the mean absolute error of the prediction results and sums them to obtain the final SOH estimate.
[0043] Here we design a weighting method for each sub-estimator. During the model pre-training and fine-tuning phases, since the SOH labels of the battery data are known, the weights of the i-th sub-estimator are... i The calculation method is as follows:
[0044]
[0045]
[0046]
[0047] in, Represents the predicted value of the i-th sub-estimator Compared with the true value The mean absolute error; sorted indicates ascending order, Emse Pos is the set of errors of the M sub-estimators sorted in ascending order; Pos is the set of original position indices after sorting; p represents the position of the original i-th error after sorting, and Pos.index represents the corresponding index operation.
[0048] The smaller the error of the sub-estimator, the larger the weight it is assigned to the output. The largest error percentage is used as the weight for the output with the smallest error, and so on. All weights sum to 1. Therefore, the output of the TLAFM SOH estimator is...
[0049]
[0050] in, This represents the output of the i-th sub-estimator.
[0051] For each iteration of model training, the root mean square error (RMSE) is used as the loss function to calculate the error between the model's output capacity and the true capacity. Stochastic gradient descent is then used to optimize the model parameters. As shown in (14),
[0052]
[0053] Where, n s Indicates the number of samples. and This represents the predicted and actual SOH values for the source domain.
[0054] The TLAFM method divides the model optimization process into two stages: the first is the offline training stage, which uses an existing complete dataset of batteries from cycle to failure to pre-train the model; the second is the online prediction stage, which freezes the parameters of the bottom network layer of the pre-trained model and uses a small number of target battery data samples as input to fine-tune the parameters of the top network layer of the model.
[0055] Offline training phase: The preceding steps (1) to (4) belong to the offline training phase. After preprocessing the data, it is input into the Transformer model containing the adaptive module. The model parameters are continuously optimized by continuously optimizing the loss function, so that the estimation accuracy is continuously improved and the ability to learn basic degradation features and degradation trajectories is enhanced.
[0056] Online fine-tuning and testing: Step 5) involves online fine-tuning of some parameters of the model and evaluating the optimized model using test data. In each iteration, the largest batch size among the M target battery data sets is set as the number of alternating loops. In one iteration, batch data from all target batteries are sequentially input into the model to fine-tune the parameters of the corresponding modules. Each battery is assigned an adaptive module. When using different battery data, the model only fine-tunes its corresponding adaptive module, freezing the others. Finally, the test data from the M target batteries are input into the optimized TLAFM model, and two evaluation metrics are calculated to assess the model's performance. The calculation formulas are as follows.
[0057]
[0058]
[0059] Where, n p This represents the number of data samples for the p-th target battery; and c p,i Let SOH and RMSE represent the estimated and true SOH and RMSE of the i-th sample of the p-th target cell, respectively. soh It is used to calculate the root mean square error between the predicted and the true values; MAPE soh It is the average absolute percentage error between the predicted value and the actual value.
[0060] Beneficial effects of the present invention
[0061] Compared with the prior art, the advantages of this invention are:
[0062] Existing technologies often transfer models trained on battery data under fixed operating conditions to lithium batteries under another single operating condition, resulting in low adaptability to different unknown operating conditions. However, by employing an adaptive module, advanced degradation characteristics of lithium batteries under different operating conditions can be learned.
[0063] An adaptive fusion strategy based on a multi-head attention mechanism is adopted to fuse the outputs of all adaptive modules. On the one hand, connecting the adaptive modules facilitates model training; on the other hand, attention-weighted fusion of different battery degradation features is beneficial for learning the degradation trajectory of the capacity.
[0064] A weighting method based on prediction loss is used, which can calculate the prediction loss using the current period's true SOH value during the training phase with labeled data and use the estimation error of the previous period during the testing phase with unlabeled data. This further enhances the model's transfer learning ability on a small number of target data and improves the accuracy of prediction. Attached Figure Description
[0065] Figure 1 This is a schematic diagram of the structure of the present invention.
[0066] Figure 2 This is a schematic diagram of the process of the present invention. Detailed Implementation
[0067] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0068] Please see Figures 1 to 2 A method for estimating the health status of lithium batteries based on adaptive migration includes the following steps, and the network architecture is shown in the attached figure. Figure 1 As shown, the flowchart for model training and optimization is as follows: Figure 2 As shown:
[0069] Step 1). Given a complete dataset of battery degradation from cycle to failure (source domain) and partial degradation data of batteries under unknown operating conditions to be predicted online (target domain).
[0070] Step 2). Integrate the health indicators that are highly correlated with SOH during the constant voltage charging stage and preprocess the integrated data using a sliding time window technique and a normalization method.
[0071] Step 3). Using Transformer as the main body, an adaptive module is added to extract advanced degradation features of batteries under different operating conditions. An adaptive fusion strategy with multi-head attention mechanism effectively combines the outputs of all adaptive modules.
[0072] Step 4). Based on the predicted loss, weight and integrate the outputs of all SOH sub-estimates as the final SOH estimate, and then optimize and train the model.
[0073] Step 5). When fine-tuning the model parameters, adjust the adaptive module and SOH estimator in the model, and freeze the rest to achieve SOH estimation.
[0074] Step 1) Given a complete degradation dataset of a battery cycled to failure and partial degradation data of the battery under unknown operating conditions to be predicted online. As shown in equations (1) and (2):
[0075]
[0076]
[0077] Among them, B S Represents a complete source domain degradation data sample, ns Indicates the number of samples in the source domain. and Let B represent the degraded data of the i-th sample in the source domain and its corresponding capacity label, respectively. T This represents the collection of degraded data in the target domain. and Let represent the data samples and their quantity in the p-th target domain, and M represent the number of different unknown operating conditions of the SOH battery to be predicted online. and Let represent the degraded data of the j-th sample in the p-th target domain and its corresponding capacity label, respectively.
[0078] Step 2) Preprocess the data from step (1) using a sliding time window technique and a max-min normalization method. The sliding time window technique is used to convert the degraded data into a time series input, with an input time window size of N. tw The time step is t d The input data at the i-th time step can be represented as:
[0079]
[0080] in, This indicates selecting data from row i to row (i+N). tw -t d The row data is used as the input data for the i-th time step, x i,s Let represent the s-th data item of the i-th data sample. Then, the data is normalized using the following formula.
[0081]
[0082] in, Max(x) represents the j-th reading of the k-th selected sensor in the data sample. k min(x) k ) represent the maximum and minimum values among the readings of the k-th selected sensor, respectively. for Normalized data sample.
[0083] Step 3) Input the processed data into a Transformer with an adaptive module, abbreviated as TLAFM. Its structure is as follows: Figure 1 As shown, it consists of two parts: an encoder and a decoder. The encoder encodes the input health indicators into a vector sequence with time dependencies, and the decoder decodes the vector sequence into a tensor representing capacity degradation.
[0084] Positional encoding: In Transformer, a positional encoding mechanism is introduced to encode the temporal information of the input sequence into the representation of each time step. Therefore, the temporal dependencies of the input sequence can be preserved by performing the following calculation on the data processed in step (2).
[0085]
[0086] Where PE represents an unknown encoding operation, pos represents the position of a data item in a data record, the position encoding of each data item is a vector, i represents the index of each element in this vector, and d input Indicates the dimension of the input data; PE(x) i ) is for data x i The result after position encoding, Z i This represents the final result after residual connection.
[0087] The encoder consists of multiple identical encoder layers, each composed of two parts: a multi-head self-attention mechanism (MultiHeadAttention) and a position-level feedforward network (FFN). Both parts have a residual connection and a layer normalization (LayerNorm). The Z-axis is encoded via position... i The data is input to the encoder and passes through multiple encoder layers to obtain a vector sequence Vec containing time information. The calculation process for the p-th encoder layer is as follows:
[0088]
[0089] Where Q, K, and V are computational vectors with the same dimension as the input data in the multi-head attention mechanism, used to capture dependencies and dynamically allocate weights; concat represents the vector concatenation operation; head en,h W represents the data of the h-th head. en,p , and The weights represent learnable parameters; Attention represents the attention mechanism; softmax is an activation function; d k Indicates the input data dimension for each head; en_h1 represents the result after residual connection, en_h2 represents the output of the position-level feedforward network, W en,1 W en,2 and b en,1 b en,2 These represent the learnable weights and biases, respectively; Vec p and Vec p-1 This represents the output of the p-th encoder and the encoder preceding it.
[0090] Decoder: It also consists of multiple decoder layers, the number of which is generally the same as that of the encoder. For example... Figure 1 As shown in (b), each layer comprises three parts: a MaskedMultiHead self-attention mechanism, a multi-head contextual attention mechanism, and a position-level forward propagation network (FFN). Similar to the encoder, these three parts share a residual connection followed by a layer for normalization. The decoder's input is the encoder's output. Furthermore, the second part of the decoder, the multi-head contextual attention mechanism, has two inputs: the output of the previous part and the encoder's output. Therefore, the output of the q-th decoder can be calculated as follows:
[0091]
[0092] Where Q, K, and V are computational vectors with the same dimension as the input data in the multi-head attention mechanism, used to capture dependencies and dynamically allocate weights; concat represents the vector concatenation operation; mask is a matrix of 0s and 1s with the same length as the input sequence, used to control the model to ignore invalid or padded parts when processing sequence data; head de,h W represents the data of the h-th head. de,p , and Represents learnable weight parameters; MaskedAttenuates represents the masked attention mechanism; softmax is an activation function; d k This represents the input data dimension for each head; de_h1 and de_h3 represent the results after the residual connections, and de_h3 represents the output of the position-level feedforward network. W de,1 W de,2 and b de,1 b de,2 Represent the learnable weights and biases, respectively; Out q and Out q-1 This represents the output of the q-th encoder and its preceding decoder.
[0093] Adaptive Module: This is a lightweight incremental structure designed for online prediction of specific target batteries. It takes battery data under unknown operating conditions as input and adapts it to a pre-trained Transformer model by adding a small number of parameters. It can quickly adapt to new battery data under unknown operating conditions, thus reducing the time and cost of retraining. For each Transformer layer, two adaptive modules are added, located after the forward propagation layers in the encoder and decoder, respectively. Figure 1 As shown in (c), each adaptive module mainly consists of two feedforward sub-layers. The first feedforward sub-layer takes the output of the Transformer's forward propagation layer as input and converts the original input dimension d... input (High-dimensional features) projected onto dm (Low-dimensional features), by controlling d m The size of d is used to limit the number of parameters in the adaptive module. Typically, d... input >>d m Then, the middle of the module passes through a non-linear layer, implemented by the GELU activation function, as shown in the following formula.
[0094]
[0095] Here, x represents the input feature of the activation function, and tanh is an activation function.
[0096] In the output phase, the module restores the input dimension through a second feedforward sub-layer, converting d... m (Low-dimensional features) are remapped back to d input The original high-dimensional features are used as the module's output. Simultaneously, a residual connection is used to add the adaptive module's input to the final output. This ensures training effectiveness even if the adaptive module's initial parameters are close to 0, through an approximate identity mapping. See below.
[0097] h ad ←h ad +GELU(h ad W ad,1 W ad,2 (9)
[0098] Among them, h ad W represents the hidden feature output by the adaptive module. ad,1 and W ad,2 This represents the learnable weight parameters in the adaptive module.
[0099] The adaptive fusion strategy based on multi-head attention is the core of our proposed framework. The main idea is to connect multiple adaptive modules, each corresponding to a different battery, to achieve better feature fusion and representation learning. By connecting multiple adaptive modules, features at different levels can be fused, thereby improving model performance. Furthermore, this strategy can learn different adapter parameters to adapt to different tasks and data, further improving the model's generalization ability and efficiency. It allows for selective adaptation to different tasks without changing the pre-trained model structure.
[0100] This patent aims to enable multiple target batteries to share a single prediction model while maintaining estimation accuracy. To this end, we assign an adaptive module to each battery's data set for extracting specific battery degradation features. Subsequently, an adaptive fusion strategy is proposed to weightedly integrate the outputs of all adaptive modules, thereby obtaining degradation features favorable to the current prediction target. Figure 1 As shown in (d), the core of the fusion strategy proposed in this patent is a multi-head attention mechanism. First, the attention score of each adaptive module with the input battery data is calculated. Then, the attention scores are normalized using the softmax activation function to obtain the attention weights. Finally, the attention weights are weighted and summed with the outputs of all adaptive modules to obtain the fused feature representation. The calculation formula is as follows:
[0101]
[0102] Among them, h n F represents the output of the nth battery data after passing through the position-level forward propagation layer. n Represents the hidden feature h n The output W obtained by inputting into the nth adaptive module n,1 and W n,2 This represents the learnable weight parameters; data from each battery needs to be passed to the corresponding adaptive module, where all adaptive features are concatenated and their weights are calculated using a multi-head attention mechanism. `concat` represents the concatenation operation. and These represent the results after concatenating the output and input data of the adaptive module, respectively; F represents the feature representation after fusion via a multi-head attention mechanism, and W... f and b f This represents the learnable weights and biases.
[0103] Step 4) Input the result decoded by the Transformer into the SOH estimator. For example... Figure 1 As shown in (f), the SOH estimator consists of three parts. The first part is a random deactivation layer and a dense layer, which receive the output of the last decoder and reduce the risk of overfitting. The second part consists of M sub-estimators that can generate M SOH estimates simultaneously. Each sub-estimator includes a linear layer and two activation function layers. The Tanh activation function layer is located before the linear layer and mainly learns the complex nonlinear functional relationship between features and labels. The Sigmoid activation function layer is located at the top and is used to map the output to a value between 0 and 1. The third part assigns weights to the M values based on the mean absolute error of the prediction results and sums them to obtain the final SOH estimate.
[0104] Here we design a weighting method for each sub-estimator. During the model pre-training and fine-tuning phases, since the SOH labels of the battery data are known, the weights of the i-th sub-estimator are... i The calculation method is as follows:
[0105]
[0106]
[0107]
[0108] in, Represents the predicted value of the i-th sub-estimator Compared with the true value The mean absolute error; sorted indicates ascending order, E mse `Pos` is the set of errors from the M sub-estimators sorted in ascending order; `Pos` is the set of original position indices after sorting; `p` represents the position of the original `i`-th error after sorting, and `Pos.index` represents the corresponding indexing operation. The main idea of this method is that the output of the sub-estimator with the smaller error is assigned a larger weight. The largest error proportion is used as the weight for the output with the smallest error, and so on. All weights sum to 1. Therefore, the output of the SOH estimator in TLAFM... for
[0109]
[0110] in, This represents the output of the i-th sub-estimator.
[0111] For each iteration of model training, the root mean square error (RMSE) is used as the loss function to calculate the error between the model's output capacity and the true capacity, and stochastic gradient descent is used to optimize the model parameters. Loss function As shown in (14).
[0112]
[0113] Where, n s Indicates the number of samples. and This represents the predicted and actual SOH values for the source domain.
[0114] Step 5) The TLAFM proposed in this patent is a multi-task learning method. In multi-task learning, the system learns a single model simultaneously to solve multiple tasks, rather than training a separate model for each task. Since the SOH estimation of the battery under different operating conditions requires extracting degradation features during the charging and discharging process, this method can enhance the feature learning capability of the target battery prediction task under different operating conditions by sharing the parameters of the feature extractor. Figure 2 As shown, this method divides the model optimization process into two stages: the first is the offline training stage, which uses an existing complete dataset of batteries from cycle to failure to pre-train the model; the second is the online prediction stage, which freezes the parameters of the bottom network layers of the pre-trained model and uses a small number of target battery data samples as input to fine-tune the parameters of the top network layers of the model.
[0115] Offline training phase: The preceding steps (1) to (4) belong to the offline training phase. After preprocessing the data, it is input into the Transformer model containing the adaptive module. The model parameters are continuously optimized by continuously optimizing the loss function, so that the estimation accuracy is continuously improved and the ability to learn basic degradation features and degradation trajectories is enhanced.
[0116] Online Fine-tuning and Testing: Step 5) involves online fine-tuning of some model parameters and evaluating the optimized model using test data. Unlike traditional fine-tuning strategies that freeze the lower layers and adjust the higher layers, the TLAFM-based model adjusts the adaptive modules and the SOH estimator. The number of iterations for model fine-tuning is usually the same as that for pre-training. M target battery data will be used simultaneously as input to optimize model parameters and improve their respective prediction accuracy. However, due to the different operating conditions of the target batteries, their capacity degradation also exhibits different trajectories. Therefore, to minimize the impact of the model learning the degradation trajectory of one battery on other batteries, we designed a batch alternating training method. In each iteration of optimization, we set the largest batch size among the M target battery data as the alternating loop number. In one iteration, the batch data of all target batteries are sequentially input into the model to fine-tune the parameters of the corresponding modules. Each battery is assigned an adaptive module. When using different battery data, the model only fine-tunes its corresponding adaptive module, freezing the others. Because each adaptive module only specifically learns the degradation characteristics of one battery, it is necessary to ensure that the learned parameters are not affected by other battery data. Finally, the test data from M target batteries were input into the optimized TLAFM model, and two evaluation metrics were calculated to assess the model's performance. Their calculation formulas are as follows:
[0117]
[0118]
[0119] Where, n p This represents the number of data samples for the p-th target battery; and c p,i Let represent the estimated and true State of Harmony (SOH) of the i-th sample of the p-th target cell, respectively. RMSE soh It is used to calculate the root mean square error between the predicted and the true values; MAPE soh It is the average absolute percentage error between the predicted value and the actual value.
[0120] In summary, this invention proposes an adaptive transfer-based method for estimating the state of health (SOH) of lithium batteries under various operating conditions. First, a novel set of health indicators is designed to characterize the aging process. Then, the model uses a Transformer with an adaptive module as its infrastructure to extract capacity degradation features and employs a two-stage model optimization strategy. The model is pre-trained using the source battery dataset, primarily to optimize its ability to learn basic degradation features and trajectories. Next, the network layers in the Transformer encoder and decoder, except for the adaptive structure, are frozen. Partial data from multiple target batteries are input into the model to fine-tune the adaptive structure and the weight parameters of the SOH estimator. The optimized model can then be used to obtain the future SOH values of multiple target batteries. Finally, experiments demonstrate that the proposed model possesses high accuracy and generalization performance.
[0121] The above description is merely a preferred embodiment of the present invention; however, the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concepts, should be covered within the scope of protection of the present invention.
Claims
1. A method for estimating the state of health of a lithium battery based on adaptive migration, characterized in that, Includes the following steps: Step 1). Given a complete existing battery degradation dataset from cycle to failure and partial degradation data of the battery under unknown operating conditions to be predicted online; Step 2). Integrate the health indicators that are highly correlated with SOH during the constant voltage charging stage and preprocess the integrated data using a sliding time window technique and a normalization method; Step 3). Using Transformer as the main body, an adaptive module is added to extract advanced degradation features of batteries under different operating conditions. An adaptive fusion strategy with multi-head attention mechanism effectively combines the outputs of all adaptive modules. Step 4). Based on the predicted loss, weight and integrate the outputs of all SOH sub-estimates as the final SOH estimate, and then optimize and train the model. Step 5). When fine-tuning the model parameters, adjust the adaptive module and SOH estimator in the model, and freeze the rest to achieve SOH estimation; The adaptive module is a lightweight incremental structure designed for online prediction of specific target batteries. It takes battery data under unknown operating conditions as input and adapts it to the pre-trained Transformer model by adding a small number of parameters. This allows for rapid adaptation to new battery data under unknown operating conditions, reducing retraining time and cost. For each Transformer layer, two adaptive modules are added, located after the forward propagation layers in the encoder and decoder, respectively. Each adaptive module includes two feedforward sub-layers. The first feedforward sub-layer takes the output of the Transformer's forward propagation layer as input, and adjusts the original input dimension... Projecting to lower dimensions By controlling The size of the parameter is used to limit the number of parameters in the adaptive module, where The module's middle section uses a non-linear layer, implemented with the GELU activation function, and the calculation formula is shown below. Where x represents the input feature of the activation function, and tanh is an activation function; In the output phase, the module restores the input dimension through a second feedforward sub-layer. Remapping back As the output of the module, a residual connection is used to add the input of the adaptive module to the final output. Even though the parameters of the adaptive module are initially initialized close to 0, the effectiveness of training is ensured by setting an approximate identity mapping, as shown below: in, This represents the hidden features output by the adaptive module. and This represents the learnable weight parameters in the adaptive module; The adaptive fusion strategy of the multi-head attention mechanism is as follows: The attention score of each adaptive module with the input battery data is calculated. Then, the attention scores are normalized using the softmax function to obtain the attention weights. Finally, the attention weights are weighted and summed with the outputs of all adaptive modules to obtain the fused feature representation. The calculation formula is as follows: in, This represents the output of the nth battery data after passing through the position-level forward propagation layer. Representing hidden features The output obtained by inputting into the nth adaptive module, and This represents the learnable weight parameters; data from each battery needs to be passed to the corresponding adaptive module, where all adaptive features are concatenated and their weights are calculated using a multi-head attention mechanism. `concat` represents the concatenation operation. and These represent the results after concatenating the output and input data of the adaptive module, respectively; F represents the feature representation after fusion via a multi-head attention mechanism. and Represents the learnable weights and biases; A Transformer with an adaptive module is abbreviated as TLAFM.
2. The lithium battery health state estimation method based on adaptive migration according to claim 1, characterized in that: In step 1), a complete degradation dataset of a battery cycled to failure is given, along with partial degradation data of the battery under unknown operating conditions to be predicted online, as shown in equations (1) and (2): in, This represents a complete sample of source domain degradation data. Indicates the number of samples in the source domain. and Let represent the degraded data of the i-th sample in the source domain and its corresponding capacity label, respectively. This represents the collection of degraded data in the target domain. and This represents the data samples in the p-th target domain and their quantity. This indicates the number of different unknown operating conditions that the SOH battery will be in, which will be predicted online. and Let represent the degraded data of the j-th sample in the p-th target domain and its corresponding capacity label, respectively.
3. The lithium battery health state estimation method based on adaptive migration according to claim 2, characterized in that: Step 2) preprocesses the data from step (1) using a sliding time window technique and a max-min normalization method. The sliding time window technique is used to convert the degraded data into a time series input, with the input time window size being [missing information]. The time step is The input data at the i-th time step can be represented as: in, This indicates selecting data from row i to row i. The row data is used as the input data for the i-th time step. Let represent the s-th data item of the i-th data sample. Then, the data is normalized using the following formula: in, This represents the j-th reading of the k-th selected sensor in the data sample. , These are the maximum and minimum values among the readings of the k-th selected sensor, respectively. for Normalized data sample.
4. The lithium battery health state estimation method based on adaptive migration according to claim 3, characterized in that: In step 3), the processed data is input into TLAFM, whose structure includes an encoder and a decoder. The encoder encodes the input health indicators into a vector sequence with time dependence, and the decoder decodes the vector sequence into a tensor representing capacity degradation. Positional encoding: In Transformer, a positional encoding mechanism is introduced to encode the temporal information of the input sequence into the representation of each time step. Therefore, the temporal dependencies of the input sequence can be preserved by performing the following calculation on the data processed in step (2): Where PE represents an unknown encoding operation, pos represents the position of a data item in a data record, the position encoding of each data item is a vector, and i represents the index of each element in this vector. Indicates the dimension of the input data; PE( ) is data The result after position encoding This represents the final result after residual connection.
5. The lithium battery health state estimation method based on adaptive migration according to claim 4, characterized in that: The encoder consists of multiple identical encoder layers, each layer comprising two parts: the first part being a multi-head self-attention mechanism. The second part is the location-level feedforward network. Both parts have a residual connection and a layer normalization. via position encoding The data is input into an encoder and passes through multiple encoder layers to obtain a vector sequence with time information. The calculation process for data flow to the p-th encoder layer is as follows: Where Q, K, and V are computational vectors with the same dimension as the input data in the multi-head attention mechanism, used to capture dependencies and dynamically allocate weights, and concat represents the join operation; This represents the data of the h-th header. , , and Represents the learnable weight parameters; This represents the attention mechanism; softmax is an activation function. This indicates the dimension of the input data for each head; This represents the result after residual connection. This represents the output of the position-level feedforward network. , and , These represent the learnable weights and biases, respectively. and This represents the output of the p-th encoder and the encoder preceding it.
6. The lithium battery health state estimation method based on adaptive migration according to claim 5, characterized in that: The decoder consists of multiple decoder layers, with the number of layers matching that of the encoder. Each layer contains three parts: a mask, a multi-head self-attention mechanism, and a mask. Multi-head contextual attention mechanisms and position-level forward propagation networks Like the encoder, all three parts have a residual connection followed by a normalization layer. The decoder's input is the encoder's output. Furthermore, the second part of the decoder, the multi-head contextual attention mechanism, has two inputs: the output of the previous part and the encoder's output. Therefore, the output of the q-th decoder can be calculated as follows: Where Q, K, and V are computational vectors with the same dimension as the input data in the multi-head attention mechanism, used to capture dependencies and dynamically allocate weights; concat represents the vector concatenation operation; and mask is a matrix of 0s and 1s with the same length as the input sequence, used to control the model to ignore invalid or padded parts when processing sequence data. This represents the data of the h-th header. , , and Represents the learnable weight parameters; This represents the masked attention mechanism, where softmax is an activation function. Indicates the input data dimension for each head; de and This represents the result after residual connection. This represents the output of the position-level feedforward network. , and , These represent the learnable weights and biases, respectively. and This represents the output of the q-th encoder and its preceding decoder.
7. The lithium battery health state estimation method based on adaptive migration according to claim 6, characterized in that: Step 4) inputs the result decoded by the Transformer into the SOH estimator. The SOH estimator consists of three parts. The first part is a random deactivation layer and a dense layer, which are used to receive the output of the last decoder and reduce the risk of overfitting. The second part consists of M sub-estimators, which can generate M SOH estimates at the same time. Each sub-estimator includes a linear layer and two activation function layers. The Tanh activation function layer is located before the linear layer and mainly learns the complex nonlinear function relationship between features and labels. The Sigmoid activation function layer is located at the top and is used to map the output to a value between 0 and 1. The third part assigns weights to the M values according to the mean absolute error of the prediction results and adds them to obtain the final SOH estimate. During the model's pre-training and fine-tuning phases, since the SOH labels of the battery data are known, the weights of the i-th sub-estimator... The calculation method is as follows: in, Represents the predicted value of the i-th sub-estimator Compared with the true value The mean absolute error; This indicates an ascending order sorting operation. It is the set of errors of the M sub-estimators arranged in ascending order; It is the set of original position indices after sorting; This indicates the position of the original i-th error after sorting. This indicates the corresponding indexing operation. The output of the sub-estimator with the smaller error is assigned a larger weight. The largest error percentage is used as the weight for the output with the smallest error, and so on. All weights sum to 1. Therefore, the output of the TLAFM SOH estimator... for in, This represents the output of the i-th sub-estimator; For each iteration of model training, the root mean square error (RMSE) is used as the loss function to calculate the error between the model's output capacity and the true capacity. Stochastic gradient descent is then used to optimize the model parameters. As shown in (14), in, Indicates the number of samples. and This represents the predicted and actual SOH values for the source domain.
8. The lithium battery health state estimation method based on adaptive migration according to claim 7, characterized in that: The TLAFM method divides the model optimization process into two stages: the first is the offline training stage, which uses an existing complete dataset of batteries from cycle to failure to pre-train the model; the second is the online prediction stage, which freezes the parameters of the bottom network layer of the pre-trained model and uses a small number of target battery data samples as input to fine-tune the parameters of the top network layer of the model. Offline training phase: The preceding steps (1) to (4) belong to the offline training phase. After preprocessing the data, it is input into the Transformer model containing the adaptive module. The model parameters are continuously optimized by continuously optimizing the loss function, so that the estimation accuracy is continuously improved and the ability to learn basic degradation features and degradation trajectories is enhanced. Online fine-tuning and testing: Step 5) involves online fine-tuning of some parameters of the model and evaluating the optimized model using test data. During each iteration of optimization, the following settings will be configured: The largest batch size among the target battery data is used as the number of alternating loops. In one iteration, batch data from all target batteries are sequentially input into the model to fine-tune the parameters of the corresponding modules. Each battery is assigned an adaptive module. When using different battery data, the model only fine-tunes its corresponding adaptive module, freezing the others. Finally... The test data of the target battery were input into the optimized TLAFM model, and two evaluation metrics were calculated to evaluate the model's performance. The calculation formulas are as follows. in, This represents the number of data samples for the p-th target battery; and Let Si and Sh represent the estimated and true SOH of the i-th sample of the p-th target cell, respectively. It is used to calculate the root mean square error between the predicted and the actual values; It is the average absolute percentage error between the predicted value and the actual value.
Citation Information
Patent Citations
Lithium battery health state estimation method based on joint weighted domain adversarial network
CN116027198A
Method and apparatus for estimating state of health of battery
US20230349977A1
