Lithium-ion battery capacity prediction method based on transfer learning
By using a transfer learning-based approach, a capacity prediction model was constructed using source domain battery data and then fine-tuned. This solved the problem of error accumulation in lithium-ion battery capacity prediction and achieved high-precision battery capacity prediction and lifespan assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2026-03-27
AI Technical Summary
Existing lithium-ion battery capacity prediction methods are prone to error accumulation during multi-step prediction processes, resulting in inaccurate prediction curves and an inability to effectively determine the end of battery life.
A transfer learning-based approach was adopted to construct a capacity prediction model using long short-term memory neural networks and attention mechanisms based on the capacity data of source batteries. Source batteries were selected by dynamic time warping, capacity degradation rate and cycle ratio. The model was then fine-tuned by combining the known data of the target battery to establish a trained capacity prediction model.
It improves the accuracy and precision of lithium-ion battery capacity prediction, enables long-term prediction of battery capacity degradation trends, provides a basis for battery life assessment, and is applicable to lithium-ion batteries under different operating conditions.
Smart Images

Figure CN116338489B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of battery management, and particularly relates to a lithium ion battery capacity prediction method based on transfer learning. BACKGROUND
[0002] Lithium ion batteries are widely used in military, aerospace, portable terminals, electric vehicles and other fields due to their high output voltage, long cycle life, high energy density, environmental friendliness and other advantages. However, the performance of lithium ion batteries decreases with the decrease of use time and electrochemical composition, resulting in capacity and power attenuation, and battery failure may be caused when the capacity decreases to a failure threshold, so battery capacity prediction plays an important role in improving the safety and reliability during the use of the battery.
[0003] According to the number of prediction steps, the lithium ion battery capacity prediction can be divided into single-step prediction and multi-step prediction. The single-step prediction is to predict the capacity of the next period according to the capacity data of the current period, and the multi-step prediction is to predict the capacity of the next period by using the real capacity data of the previous several periods, and to update the input sequence by using the predicted value to predict the capacity of the next period. In the multi-step prediction process, the real data is only used in the prediction of the previous several periods, and the predicted capacity data is used to update the input. When the predicted capacity value is greater than the real data of the previous several periods, the predicted degradation curve will show a trend of flying up. When the predicted capacity value is very small, the predicted degradation curve will be almost a straight line. In addition, with the increase of the period, the predicted capacity data gradually deviates from the real data, so the error accumulates more and more.
[0004] Transfer learning refers to transferring labeled data or knowledge structure from related fields to complete or improve the learning effect of the target domain. Transfer learning can utilize the similarity between data, tasks or models to apply the model and knowledge learned in the old field (source domain) to the new field (target domain). For lithium ion battery capacity prediction, the complete capacity data of the source domain battery can help determine the overall degradation trend of the target battery and make up for the missing information of the subsequent periods of the target battery. Therefore, the application provides a lithium ion battery capacity prediction method based on transfer learning, which establishes a pre-training model from the source domain battery, fine-tunes the pre-training model with a small amount of data of the target battery, and obtains a final prediction model, which can effectively solve the problems of large cumulative error and upward or straight prediction curve. SUMMARY
[0005] In view of the deficiencies of the prior art, the technical problem to be solved by the application is to provide a lithium ion battery capacity prediction method based on transfer learning.
[0006] The technical solution adopted by the application to solve the technical problem is:
[0007] A lithium ion battery capacity prediction method based on transfer learning, characterized in that the method comprises the following steps:
[0008] Step 1: Perform a charging experiment on the battery, sample the current during the charging process, and calculate the battery capacity of each cycle;
[0009] Step 2: Randomly select a battery from the data set as the target battery, calculate the minimum distance between the target battery and the remaining battery capacity sequence using dynamic time warping, and select the remaining battery with the minimum distance within the distance threshold range as the candidate battery;
[0010] According to formula (2), calculate the capacity degradation rate R of the target battery and each candidate battery, and select the candidate battery with the capacity degradation rate within the threshold interval as the closest candidate battery;
[0011]
[0012] In formula (2), Q w%×K represents the capacity of the battery at the w%×Kth cycle, K is the total number of cycles, w∈(0,100], and Q1 represents the capacity of the first cycle of the battery;
[0013] According to formula (3), calculate the cycle ratio δ of the target battery and each closest candidate battery, and select the closest candidate battery with the cycle ratio within the cycle ratio threshold range as the source domain battery;
[0014]
[0015] In formula (3), represents the length of the capacity sequence of the target battery A before w% of the total cycles, represents the length of the capacity sequence of the qth candidate battery before w% of the total cycles;
[0016] Step 3: Construct a capacity prediction model based on a long short-term memory neural network and an attention mechanism; the capacity prediction model includes multiple long short-term memory units, and the outputs of all long short-term memory units are calculated through attention after two fully connected layers to obtain the model output;
[0017] Pre-train the capacity prediction model using the capacity data of the source domain battery to obtain a pre-trained capacity prediction model; keep the parameters of the pre-trained capacity prediction model unchanged except for the two fully connected layers, and retrain the pre-trained capacity prediction model using the capacity data of the target battery to obtain a trained capacity prediction model;
[0018] Step 4: input the capacity data [Q m-r+1 , Q m-r+2 ,..., Qm Input into the trained capacity prediction model, get the m+1 cycle capacity prediction value Wherein m represents the cycle number of the known capacity data of the target battery, and r represents the input window size; the Input into the trained capacity prediction model, get the m+2 cycle capacity prediction value In this way, the capacity prediction of the target battery is completed.
[0019] Further, the distance threshold range is [0.002, 0.02]; the threshold interval of the capacity degradation rate is [R0-0.005, R0+0.005], R0 represents the capacity degradation rate of the target battery; the cycle ratio threshold range is [0.8, 1.3].
[0020] Further, the attention calculation is performed according to the following formula:
[0021]
[0022] In formula (5), h g represents the output of the gth long short-term memory unit, T represents the matrix transpose, ω and b represent the weight matrix and the bias respectively, Φ(·) represents the nonlinear activation function, s g represents the attention weight of the output of the gth long short-term memory unit, softmax(·) represents the activation function, α g represents the normalized attention weight, O represents the feature vector obtained by attention calculation, H={h1, h2,..., h g ,..., h G} T represents the vector composed of the outputs of all long short-term memory units, G represents the number of long short-term memory units, A={α1, α2,..., α g ,..., α G} represents the attention weight vector, represents the dot product of the corresponding elements of the two vectors.
[0023] Compared with the prior art, the beneficial effects of the present application are as follows:
[0024] 1. The present application is based on the capacity data of the total cycle of each battery within the first 30%, and gradually selects the source domain battery with three indicators of dynamic time warping, capacity degradation rate and cycle ratio. The capacity degradation trend of the source domain battery is most similar to that of the target battery, and the source domain battery is used as a sample battery for transfer learning. Based on transfer learning, the capacity prediction model is pre-trained using the capacity data of the source domain battery, and the pre-trained capacity prediction model is fine-tuned using the capacity data of the known cycle of the target battery to obtain the trained capacity prediction model, which is used for capacity prediction of the target battery. Since the capacity data of the target battery is missing, the capacity degradation trend of the source domain battery and the target battery is similar, and the model learns the global information similar to the target battery through the capacity data of the source domain battery, so as to provide a reference for the target battery under the condition of unknown global capacity degradation trend of the target battery, and make up for the missing global information of the target battery. The model is fine-tuned combined with the known data of the target battery to improve the prediction ability of the model. Compared with the existing technology of specifying the source domain battery, the present application can significantly improve the prediction accuracy.
[0025] 2. The capacity prediction model is established based on long short-term memory neural network and attention mechanism. The long short-term memory neural network is suitable for prediction of time series data, can learn long-term dependent information, and realizes multi-step or long-term prediction; the attention mechanism assigns attention weight to the most relevant information to improve the accuracy of the model.
[0026] 3. The verification results show that the method of the present application can predict the capacity of the battery for a long time, provide a basis for judging whether the battery has reached the end of life and whether it needs to be replaced, and the method is suitable for lithium ion batteries under different working conditions. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 is the overall flowchart of the present application;
[0028] Figure 2 is the battery charging curve of the present application;
[0029] Figure 3 is the capacity degradation curve of the target battery Battery#16 and the corresponding source domain battery in the embodiment of the present application;
[0030] Figure 4 is the capacity degradation curve of the target battery Battery#36 and the corresponding source domain battery in the embodiment of the present application;
[0031] Figure 5 is the capacity degradation curve of the target battery Battery#68 and the corresponding source domain battery in the embodiment of the present application;
[0032] Figure 6Figure 1 is a capacity prediction curve comparison chart of a target battery Battery#16 in an embodiment of the present application;
[0033] Figure 7 Figure 2 is a capacity prediction curve comparison chart of a target battery Battery#36 in an embodiment of the present application;
[0034] Figure 8 Figure 3 is a capacity prediction curve comparison chart of a target battery Battery#68 in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solutions of the present application will be described in detail below in combination with the drawings and specific embodiments, but the protection scope of the present application is not limited thereto.
[0036] The present application provides a lithium ion battery capacity prediction method based on transfer learning (referred to as method, see Figures 1-8 ), the specific steps are as follows:
[0037] Step 1: Perform a charging experiment on the battery, sample the current during the charging process, and calculate the battery capacity of each cycle by formula (1);
[0038]
[0039] In formula (1), Q k represents the battery capacity of the kth cycle, k = 1, 2, 3,..., K, K is the total number of cycles, and the total number of cycles of different batteries may be different; I k,j represents the current at the jth sampling point in the kth cycle, t k,j , t k,j+1 respectively represent the Ith and I+1th sampling time points in the kth cycle, and n represents the number of sampling points in each cycle.
[0040] Step 2: Based on the capacity data of w% (w e (0, 100]) of the total cycle of each battery, a battery is randomly selected from the data set as a target battery, and source domain batteries are gradually selected according to three indexes of dynamic time warping, capacity degradation rate and cycle ratio, and the source domain batteries are used as sample batteries for transfer learning;
[0041] Step 2.1: Randomly select a battery from the data set as a target battery, denoted as A; based on the capacity data of 30% of the total cycle of each battery, first calculate the minimum distance between the capacity sequence of the target battery and the remaining batteries in the data set using dynamic time warping, the smaller the distance, the higher the similarity of the capacity degradation of the two batteries, and select the remaining batteries with the minimum distance within the distance threshold range as candidate batteries; the distance threshold range is [0.002, 0.02];
[0042] Step 2.2: Calculate the capacity degradation rate R of the target battery and each candidate battery according to formula (2), the capacity degradation rate reflects the overall degradation trend of the battery capacity, and select the candidate battery whose capacity degradation rate is in the interval [R0-0.005, R0+0.005] as the closest candidate battery, R0 represents the capacity degradation rate of the target battery;
[0043]
[0044] In formula (2), Q w%×K represents the capacity of the battery at the w%*Kth cycle, Q1 represents the capacity of the battery at the first cycle;
[0045] Step 2.3: Calculate the cycle ratio δ of the target battery and each closest candidate battery according to formula (3), the cycle ratio reflects the life distribution of the two batteries, and the closer the cycle ratio is to 1, the more similar the life distribution of the two batteries is; select the closest candidate battery whose cycle ratio is in the cycle ratio threshold range as the source domain battery; the cycle ratio threshold range is: [0.8, 1.3];
[0046]
[0047] In formula (3), Q represents the length of the capacity sequence of the target battery A before the w% of the total cycle, Qq represents the length of the capacity sequence of the qth candidate battery before the w% of the total cycle;
[0048] Step 3: Construct a capacity prediction model based on a long short-term memory neural network and an attention mechanism; the capacity prediction model includes multiple long short-term memory units, and the outputs of all long short-term memory units are calculated through attention after two fully connected layers to obtain a prediction result;
[0049] The long short-term memory unit includes a forgetting gate f t , an input gate i t and an output gate o t , and the expression is:
[0050]
[0051] In formula (4), h t-1 represents the output at t-1, x t represents the input at t, W f and b f represent the weight matrix and bias of the forgetting gate respectively, W i and b i represent the weight matrix and bias of the input gate respectively, W c and b c represent the weight matrix and bias of the temporary cell state h respectively, and Ct , C t-1 , respectively represent the unit states at time t, t-1, W o , b o , respectively represent the weight matrix and bias of the output gate, h t , respectively represent the output at time t, and sigma represents the sigmoid function, and tanh represents the activation function.
[0052] The outputs of all long short-term memory units are subjected to attention calculation according to formula (5):
[0053]
[0054] In formula (5), h g , respectively represent the output of the gth long short-term memory unit, T represents the matrix transpose, and omega and b represent the weight matrix and bias, respectively, and Phi (·) represents a nonlinear activation function, s g , respectively represent the attention weight of the output of the gth long short-term memory unit, and softmax (·) represents an activation function, alpha g , respectively represent the normalized attention weight, O represents a feature vector obtained through attention calculation, and H = {h1, h2,..., h g ,..., h G} T , respectively represent a vector composed of the outputs of all long short-term memory units, G represents the number of long short-term memory units, and A = {alpha1, alpha2,..., alpha g ,..., alpha G} represents an attention weight vector, , respectively represent the dot product of corresponding elements of two vectors.
[0055] The capacity data of the target battery and the source domain battery are respectively subjected to spatial reconstruction by using a sliding window method, the pre-training capacity prediction model is obtained by using the spatially reconstructed capacity data of the source domain battery to pre-train the capacity prediction model;
[0056] The spatial reconstruction of the capacity data is represented as:
[0057]
[0058] In formula (4), Q r , respectively represent the capacity data of the battery in the rth period, r [1, m] represents the size of the sliding window, and “|” represents the separator between the model input and the output, the left side is the model input, and the right side is the model output.
[0059] On the basis of the pre-trained capacity prediction model, the parameters of the pre-trained capacity prediction model except for the two fully connected layers are kept unchanged, the capacity data of the target battery after spatial reconstruction is used, the pre-trained capacity prediction model is retrained based on transfer learning, and the parameters of the two fully connected layers are fine-tuned through back propagation, to obtain the trained capacity prediction model.
[0060] Step 4: input the capacity data [Q m-r+1 , Q m-r+2 ,..., Q m ] of the target battery into the trained capacity prediction model to obtain the capacity prediction value of the m+1 period wherein m represents the number of periods of known capacity data of the target battery, and m+1 represents the starting point of capacity prediction of the target battery; the capacity prediction value is used to update the input data, i.e. is input into the trained capacity prediction model to obtain the capacity prediction value of the m+2 period , and so on, the input data is iteratively updated to obtain the capacity prediction value of the target battery According to the capacity data of each period of the target battery, the capacity degradation curve can be obtained.
[0061] Embodiment
[0062] The battery data set of this embodiment comes from an accelerated aging experiment conducted by Massachusetts Institute of Technology and Stanford University, and the data set consists of 124 LFP batteries produced by A123 Systems company, and the battery parameters are shown in Table 1.
[0063] Table 1 Battery parameters
[0064] Manufacturer A123 Systems Type APR 18650M1A Cathode / Anode LiFeP04 / Graphite Rated capacity / Rated voltage 1.1 Ah / 3.3 V Cut-off voltage 3.6 V, 2 V Ambient temperature 30℃ Discharge current 4C
[0065] Step 1: perform a charging experiment on each battery, collect the current during the charging process, and calculate the capacity of each period according to formula (1);
[0066] The environmental temperature of the charging experiment is set to 30℃, all batteries are cycled under different fast charging conditions and cycled under the same discharging conditions (4C-2.0V, wherein 1C is 1.1A); the battery is first charged to 80% SOC under fast charging conditions through two-step high CC rate charging, and after standing for 10 seconds, the battery is charged to 3.6V at 1C, and then charged to 100% SOC at 3.6V constant voltage; the fast charging condition is: the average charging rate is 3.6C-6C, and the fast charging time is close to 10 min.
[0067] Step 2: Take the capacity data of the total period of 30% of each battery, and randomly select one battery from the data set as the target battery; first, calculate the minimum distance between the target battery and the remaining battery capacity sequence using dynamic time warping, and select the remaining battery with the minimum distance within the distance threshold range [0.002, 0.02] as the candidate battery, a total of 6 candidate batteries; then, calculate the capacity degradation rate of the target battery and each candidate battery according to formula (2), and select the candidate battery with the capacity degradation rate within the interval [R0-0.005, R0+0.005] as the closest candidate battery, a total of 4 closest candidate batteries; calculate the cycle ratio of the target battery and each closest candidate battery according to formula (3), and select the closest candidate battery with the cycle ratio within the cycle ratio threshold range [0.8, 1.3] as the source domain battery, a total of two source domain batteries, and the capacity degradation trend of the source domain battery is most similar to that of the target battery.
[0068] The selected target battery is different, and the obtained source domain battery is also different; taking Battery#16 as the target battery, the selected source domain battery is Battery#36 and Battery#40, and the capacity degradation curves of the three batteries are as shown in Figure 3 Taking Battery#36 as the target battery, the selected source domain battery is Battery#9 and Battery#16, and the capacity degradation curves of the three batteries are as shown in Figure 4 Taking Battery#68 as the target battery, the selected source domain battery is Battery#66 and Battery#69, and the capacity degradation curves of the three batteries are as shown in Figure 5
[0069] Step 3: Construct a capacity prediction model based on a long short-term memory neural network and an attention mechanism; take a sliding window size of 10, and spatially reconstruct the capacity data of the target battery and the source domain battery; pre-train the capacity prediction model using the spatially reconstructed capacity data of the source domain battery, and obtain a pre-trained capacity prediction model; keep the parameters of the pre-trained capacity prediction model unchanged except for two fully connected layers, use the spatially reconstructed capacity data of the target battery, retrain the pre-trained capacity prediction model based on transfer learning, and fine-tune the parameters of the two fully connected layers through back propagation, and obtain a trained capacity prediction model.
[0070] Step 4: Based on the capacity data of the target battery in the total period of 30%, use the trained capacity prediction model to predict the capacity of the target battery in the subsequent period, and obtain the capacity degradation curve of the target battery;
[0071] The capacity prediction model is pre-trained with the capacity data of source domain batteries Battery#36 and Battery#40, and the pre-trained capacity prediction model parameters are fine-tuned with the capacity data of the target battery Battery#16 in the first 30% of the total cycle, and the capacity degradation curve of the target battery Battery#16 is compared as shown in FIG. 6A. Figure 6 The capacity prediction model is pre-trained with the capacity data of source domain batteries Battery#9 and Battery#16, and the pre-trained capacity prediction model parameters are fine-tuned with the capacity data of the target battery Battery#36 in the first 30% of the total cycle, and the capacity degradation curve of the target battery Battery#36 is compared as shown in FIG. 6B. Figure 7 The capacity prediction model is pre-trained with the capacity data of source domain batteries Battery#66 and Battery#69, and the pre-trained capacity prediction model parameters are fine-tuned with the capacity data of the target battery Battery#68 in the first 30% of the total cycle, and the capacity degradation curve of the target battery Battery#68 is compared as shown in FIG. 6C. Figure 8
[0072] According to the capacity prediction value and the true value of the target battery, the mean square error MSE, the root mean square error RMSE, the mean absolute error MAE and the mean absolute percentage error MAPE are calculated, and the prediction accuracy is evaluated by these four indicators.
[0073]
[0074]
[0075]
[0076]
[0077] wherein, is the capacity prediction value, Q k is the capacity true value, and K-m represents the number of prediction cycles.
[0078] The calculation results of the four errors are shown in Table 2.
[0079] Table 2 Capacity prediction error
[0080] Battery MSE RMSE MAE MAPE Battery #16 4.272e-05 0.00654 0.00457 0.00467 Battery #36 3.518e-05 0.00593 0.00528 0.00518 Battery #68 1.245e-05 0.00353 0.00266 0.00267
[0081] The results show that the mean square error MSE is not more than 0.0043%, the root mean square error RMSE is not more than 0.66%, the mean absolute error MAE is not more than 0.53%, and the mean absolute percentage error MAPE is not more than 0.52%, so the prediction accuracy of the model is high, and the battery capacity can be effectively predicted for a long time.
[0082] The invention is applicable where not mentioned.
Claims
1. A lithium-ion battery capacity prediction method based on transfer learning, characterized in that, The method includes the following steps: Step 1: Conduct a charging experiment on the battery, sample the current during the charging process, and calculate the battery capacity for each cycle; Step 2: Randomly select a battery from the dataset as the target battery, use dynamic time warping to calculate the minimum distance between the target battery and the remaining battery capacity sequence, and select the remaining batteries whose minimum distance is within the distance threshold range as candidate batteries; Calculate the capacity degradation rate R of the target battery and each candidate battery according to formula (2), and select the candidate battery whose capacity degradation rate is within the threshold range as the closest candidate battery. In formula (2), Q w%×K Q1 represents the capacity of the battery in the w%×Kth cycle, where K is the total number of cycles, w∈(0,100], and Q1 represents the capacity of the battery in the first cycle. The period ratio δ between the target cell and each closest candidate cell is calculated according to equation (3), and the closest candidate cell whose period ratio is within the period ratio threshold range is selected as the source cell. In formula (3), This represents the length of the capacity sequence of the first w% of the total cycles of target battery A. This represents the length of the capacity sequence of the first w% of the total cycles of the q-th candidate battery; The distance threshold range is [0.002, 0.02]; the capacity degradation rate threshold range is [R0-0.005, R0+0.005], where R0 represents the capacity degradation rate of the target battery; the cycle ratio threshold range is [0.8, 1.3]. Step 3: Construct a capacity prediction model based on long short-term memory neural networks and attention mechanisms; the capacity prediction model includes multiple long short-term memory units, and the outputs of all long short-term memory units are processed by attention calculation and then passed through two fully connected layers to obtain the model output; The capacity prediction model is pre-trained using the capacity data of the source battery to obtain the pre-trained capacity prediction model. The parameters of the pre-trained capacity prediction model are kept unchanged except for the two fully connected layers. The capacity prediction model is then re-trained using the capacity data of the target battery to obtain the trained capacity prediction model. Step 4: Obtain the target battery's capacity data [Q] m-r+1 Q m-r+2 ,...,Q m The input is fed into the trained capacity prediction model to obtain the capacity prediction value for the (m+1)th period. Where n represents the number of cycles for the known capacity data of the target battery, and r represents the size of the input window; The data is input into the trained capacity prediction model to obtain the capacity prediction value for the (m+2)th period. This process is repeated to predict the capacity of the target battery.
2. The lithium-ion battery capacity prediction method based on transfer learning according to claim 1, characterized in that, Attention is calculated using the following formula: In formula (5), b g Let represent the output of the g-th Long Short-Term Memory unit, T denote the matrix transpose, ω and b represent the weight matrix and bias, respectively, Φ(·) denote the nonlinear activation function, and s g The attention weights represent the output of the g-th long short-term memory unit, softmax(·) represents the activation function, and α g H represents the normalized attention weights, O represents the feature vector obtained from attention calculation, and H = {h1, h2, ..., h} g ,...,h G } T Let A represent the vector consisting of the outputs of all Long Short-Term Memory (LSTM) units, where G represents the number of LSTM units, and A = {α1, α2, ..., α...} g ,...,α G } represents the attention weight vector. This represents the dot product of corresponding elements of two vectors.
Citation Information
Patent Citations
Similar product life migration screening method and system
CN112036084A
Fuel cell degradation prediction method and device based on transfer learning and equipment
CN112380773A