Lithium battery soc prediction method based on wave mixer model
The WaveMixer model, through multi-level discrete adaptive wavelet decomposition and a past decomposable hybrid module, combined with Bayesian optimization and transfer learning, solves the accuracy and efficiency problems in lithium battery SOC prediction, and achieves high-precision, low-cost lithium battery state monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGNAN UNIV
- Filing Date
- 2025-04-28
- Publication Date
- 2026-06-26
AI Technical Summary
Existing lithium battery state of charge prediction methods suffer from reduced accuracy when faced with battery aging and parameter drift. Furthermore, Transformer models have high computational resource requirements during training and inference, and hyperparameter tuning is difficult, resulting in low efficiency in model development and deployment.
The WaveMixer model is used for lithium battery SOC prediction. Data is processed through multi-level discrete adaptive wavelet decomposition and a past decomposable hybrid module. Combined with Bayesian optimization and transfer learning, the model parameters are optimized to improve prediction accuracy and generalization ability.
It achieves high-precision lithium battery SOC prediction, reduces model training costs, ensures reliable prediction results in various scenarios, and supports real-time power assessment for electric vehicles and energy storage systems.
Smart Images

Figure CN120468666B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lithium battery SOC prediction, specifically a lithium battery SOC prediction method based on the WaveMixer model. Background Technology
[0002] State of Charge (SOC) prediction for lithium-ion batteries is a core technology of battery management systems. Its prediction principle is based on modeling the physical characteristics of the battery and real-time detection of dynamic parameters, thereby realizing real-time estimation of the remaining battery capacity. This is of great significance for improving battery efficiency, extending battery life, and ensuring the safe operation of the battery, and directly affects the safety and efficiency of electric vehicles, energy storage systems, and other scenarios.
[0003] Traditional SOC prediction methods mainly include model-based methods and data-driven methods. Model-based methods include equivalent circuit models and electrochemical models that combine filtering algorithms. Equivalent circuit models simulate the dynamic characteristics of the battery through circuit components such as resistors, capacitors, and voltage sources. Although the models are simple and computationally fast, their prediction accuracy heavily depends on the precise calibration of battery parameters. In actual operating conditions, battery aging and temperature changes can cause parameter drift in battery capacity, impedance, and voltage, thus reducing the accuracy of SOC prediction. Electrochemical models are based on the electrochemical reaction mechanism of the battery and make predictions by describing the diffusion and transport processes in the lithium-ion electrodes. Although they have high prediction accuracy, the models are complex and computationally intensive, which cannot meet the needs of real-time prediction.
[0004] Data-driven methods include Support Vector Machines (SVMs), Neural Networks (NNs), and Recurrent Neural Networks (RNNs) and their variants. SVMs predict data by finding the optimal plane to segment it into different categories. While they generalize well to small samples, they require extensive labeled data for training, and the training time is long. NNs predict data by constructing multi-layered neural networks that learn the mapping between inputs and outputs. They can handle complex nonlinear relationships, but also require significant training time and are prone to overfitting, resulting in limited generalization. RNNs and their variants can process time-series data, capturing dynamic changes during battery charging and discharging to more accurately predict State of Charge (SOC). However, these models are highly complex and require extensive time-series data for training.
[0005] In recent years, emerging models such as Transformer have received widespread attention and application in the field of lithium-ion battery state of charge (SOC) prediction. Through its powerful self-attention and multi-head attention mechanisms, it can effectively handle long-term dependencies in time series data, achieve high-precision prediction and parallel processing, and has good flexibility and adaptability. However, the complexity of Transformer models leads to the need for a large amount of computing resources during training and inference, and the high requirements for the quantity and quality of data, as well as the difficulty in hyperparameter tuning, which may reduce the efficiency of model development and deployment in practical applications. Summary of the Invention
[0006] To achieve high-precision prediction of lithium battery SOC and provide more accurate prediction data for scenarios such as electric vehicles and energy storage systems, this invention proposes a lithium battery SOC prediction method based on the WaveMixer model.
[0007] To achieve the above objectives, the present invention is implemented through the following technical solution:
[0008] This invention is a lithium battery SOC prediction method based on the WaveMixer model, comprising the following operations:
[0009] S1: Collect multiple key characteristic values of lithium batteries during the T-period before prediction, including battery pack voltage, current, maximum single cell voltage, minimum single cell voltage, highest temperature, lowest temperature, available energy, and available capacity.
[0010] S2: The collected data is organized in chronological order to form complete lithium battery data. The first 84% of the data is taken as the main dataset, and the last 16% of the data is taken as the transfer learning dataset. The main dataset is then divided into training set, validation set and test set.
[0011] S3: Construct a lithium battery SOC prediction model based on the WaveMixer model;
[0012] S4: Train and evaluate the lithium battery SOC prediction model based on the WaveMixer model in S3 using a large amount of historical data;
[0013] S5: Use Bayesian optimization to evaluate and optimize the parameters of the model obtained after S4;
[0014] S6: To further verify the model's generalization ability, the transfer learning method was used to retrain the model after S5.
[0015] In one implementation, the ratio of the training set, validation set, and test set in the master dataset is 7:1:2.
[0016] In one implementation, the lithium battery SOC prediction model is based on the WaveMixer model. The WaveMixer model adopts a multi-frequency hybrid architecture, which consists of a multi-level discrete adaptive wavelet decomposition module, a past decomposable hybrid module (PDM), and a future multi-predictor hybrid module (FMM). The multi-frequency hybrid architecture can reasonably allocate spectrum resources according to actual needs and environment, enabling it to efficiently utilize multi-frequency data information.
[0017] The multi-level discrete adaptive wavelet decomposition module employs a multi-level discrete decomposition method, using a periodic extension mode to address boundary effect problems. Based on the characteristics of the input data, this module matches the optimal basis function from the wavelet basis functions and simultaneously determines the appropriate wavelet decomposition level. The selectable wavelet basis functions include Daubechies, Symlets, Coiflets, Biorthogonal, and Haar wavelet basis functions.
[0018] The module first performs a multi-level decomposition operation with a decomposition level of 3 on the input data signal:
[0019] coeffs=wavelet_dec(signal,level=3)
[0020] Subsequently, signal reconstruction is performed based on the coefficients coeffs obtained after decomposition:
[0021] re_signal=wavelet_rec(coeffs)
[0022] By comparing the input data signa with the reconstructed data re_signa, the correlation coefficient matrix corresponding to the currently selected wavelet basis function is calculated:
[0023] corr=corrcoef(signal,re_signal)[0,1]
[0024] Where: corrcoef is the Pearson correlation coefficient matrix, and its expression is:
[0025]
[0026] Among them, signal i Represents the i-th input data; re_signal i Represents the i-th reconstructed data; This represents the average value of the input data; This represents the average value of the reconstructed data;
[0027] Furthermore, the correlation coefficient between the first and second elements in the Pearson correlation coefficient matrix is extracted, and the wavelet basis function with the largest correlation coefficient is selected dynamically and determined as the optimal basis function.
[0028] By combining the input data signal and the sampling frequency fs, the autocorrelation function Mulcor of the input data is calculated using multiple autocorrelation analysis; through multiple calculations, the inherent periodic characteristics of the data are enhanced.
[0029] Mulcor=correlate(signal,signal)
[0030] Where: `correlate` is used to calculate the cross-correlation between two one-dimensional data points, and its expression is:
[0031]
[0032] Where 'a' represents the input data. Indicates a n The complex conjugate of , where n represents the data length and q represents the index offset;
[0033] The processed autocorrelation function is subjected to a Fourier transform (FFT). During this process, the frequency axis (freq) is accurately calculated, and the frequency with the largest amplitude is extracted as the dominant frequency (MainFreq).
[0034] MainFreq=freq{k}
[0035] Where k = argmax(|FFT(Mulcor)|), represents the frequency index, and argmax(|FFT(Mulcor)|) is the index of |FFT(Mulcor)|;
[0036] in:
[0037]
[0038] Where k is the frequency index, n is the length of the input data, and j represents the imaginary unit;
[0039] Based on the length n of the input data and the filter length flter_len of the selected wavelet basis, the maximum theoretical number of levels max_level is calculated:
[0040]
[0041] At the same time, the layer number ideal_level is calculated, and its expression is:
[0042]
[0043] Ultimately, the module will return the minimum value.
[0044] min(ideal_level-1, max_level)
[0045] As the actual number of decomposition levels;
[0046] The past decomposable mixing module extracts past information and mixes seasonal and trend components at different frequencies separately. The future multi-predictor mixing module improves the accuracy of future data prediction by integrating multiple predictors, each of which makes predictions based on information at different frequencies.
[0047] For past observation data x∈R P×C Downsampling is performed, and the set of multi-frequency data χ={x0,…,x M},in, P represents the prediction window length, C represents the number of variables, m represents the number of wavelet decomposition levels, and M represents the maximum number of decomposition levels.
[0048] Projecting these multi-frequency data into the embedding layer yields deep features χ. 0 It can be formalized as:
[0049] χ 0 =Embed(χ)
[0050] Here, Embed(·) represents the embedding layer, thus obtaining the multi-frequency representation of the input data; stacked past decomposable mixing modules are used to mix past information of different frequencies. For the l-th layer past decomposable mixing module, the input is χ. l-1 Furthermore, the process of decomposing hybrid modules in the past can be formulated as follows:
[0051] χ l =PDM(χ l-1 ), l∈{0,…,L}
[0052] Where L is the total number of layers in the previously decomposable hybrid modules, and l represents one of the layers, and Where, d model The number of channels indicates the representation of the past.
[0053] In the future prediction phase, a multi-predictor hybrid module is used to integrate multi-frequency past information χ. L And generate future predictions, namely:
[0054]
[0055] in F represents the number of time steps in the final future prediction. Represents the final prediction;
[0056] Through the above design, WaveMixer can effectively capture key information from the unraveled multi-frequency observations, achieve accurate predictions of the future, and fully leverage the advantages of multi-frequency information.
[0057] The past decomposable mixing module mixes the decomposed seasonal components and trend components into multiple frequencies through past decomposition and mixing. For the l-th past decomposable mixing module;
[0058] First, the multi-frequency time data of the l-th layer χ l Decomposed into seasonal components and trend components
[0059] in, The seasonal and trend component terms are mixed to allow them to interact with information from multiple frequencies.
[0060] The l-th past decomposable hybrid module can be represented as:
[0061]
[0062] SoftShrink() is the soft thresholding function, and the processing procedure is as follows:
[0063]
[0064] Where threshold is the processing threshold and θ is the parameter to be processed;
[0065] χ l =χ l-1 +FeedForward(SeasonMix(s l )+TrendMix(t l ))
[0066] Among them, t l Represents the trend component, s l Representing seasonal components, χ l χ represents the output of the current and past decomposable hybrid module. l-1 The output of the previous decomposable mixing module is represented by WaveletDecomp(·), which represents the data decomposition module. FeedForward(·) contains two linear layers with a GELU activation function in between for information interaction between channels. SeasonMix(·) and TrendMix(·) represent seasonal component mixing and trend component mixing, respectively.
[0067] In terms of seasonal component mixing, a bottom-up approach is adopted to incorporate information from low-level fine-frequency data, thereby supplementing detailed information for coarse-frequency seasonal component modeling. A bottom-up mixing layer is used to achieve bottom-up interaction of seasonal component information in the m-th layer using residuals.
[0068] For m∶1→M:
[0069] Do
[0070] Bottom-Up-Mixing(·) is instantiated as two linear layers with intermediate GELU activation functions, and its input dimension is along the time dimension. The output dimension is
[0071] For trend components Starting with the coarsest frequency, macroscopic information is gradually transmitted to finer frequencies. A top-down hybrid layer is used to achieve top-down trend information interaction in a residual manner at the m-th layer:
[0072] For m∶(M-1)→0:
[0073] Do
[0074] Here, Top-Down-Mixing(·) consists of two linear layers with intermediate GELU activation functions, and its input dimension is... The output dimension is
[0075] By leveraging the blending of seasonal and trend components, the previously decomposable blending module gradually aggregates detailed seasonal component information from fine to coarse, and integrates macro trend component information with prior knowledge, ultimately achieving multi-frequency blending in past information extraction.
[0076] After passing through the L-layer decomposable hybrid module, the multi-frequency past information is obtained, represented as:
[0077]
[0078] Because data from different frequencies exhibit different dominant changes, their predictive capabilities also vary.
[0079]
[0080] in, Predictor represents future predictions from the data at level m. m (·) refers to the predictor for the m-th layer of data, and the final output is This represents the future prediction results for all layers.
[0081] In one implementation, Bayesian optimization is used to optimize the model hyperparameters. A surrogate model is constructed to approximate the objective function, thereby predicting the probability distribution of the objective function value under different parameter combinations. Based on this, Bayesian optimization dynamically selects the parameter point corresponding to the next current maximum expected value to achieve a better objective function value based on the prediction results of the surrogate model and uncertainty estimation. In a specific implementation, the TPE (Tree-structured Parzen) provided by Optuna is selected. Using an Estimator as a surrogate model, TPE (Tencent's Estimator for Predicted Parameters) is a kernel density estimation method that efficiently handles high-dimensional parameter spaces and dynamically adjusts the search direction in each iteration. In terms of objective function design, key hyperparameters of the model are set as optimization variables, including input data length (seq_len), predicted data length (pred_len), model dimension (d_model), fully connected layer dimension (d_ff), moving average window size (moving_avg), dropout rate (dropout), and training epochs (train_epochs). The objective function initializes the model using these parameters. After training and validation, it returns the validation loss as the objective function value. In each iteration, Optuna's Bayesian optimization framework determines the parameter combination that minimizes the current validation loss based on the surrogate model's prediction results and uncertainty estimates, and passes this combination to the objective function. The objective function initializes the model using these parameters, and after training and validation, returns the validation loss as the objective function value. Optuna updates the surrogate model based on these return values and then continues to select the next parameter point for evaluation. Through continuous iteration, Bayesian optimization gradually approaches the optimal parameter combination.
[0082] In one implementation, the constructed lithium battery SOC prediction model is retrained using the optimal parameter combination obtained through Bayesian optimization to obtain a pre-trained model.
[0083] In one implementation, transfer learning is performed on the obtained pre-trained model to improve its generalization ability; the pre-trained model is loaded and all layers are frozen to keep their weights unchanged, thereby leveraging the feature extraction capabilities learned by the pre-trained model on large-scale data. This freezing is achieved by setting the `requires_grad` attribute; the parameters of the last layer are ensured to be updatable; the model is retrained using the transfer learning dataset, updating only the weights of the last layer while keeping the weights of other layers unchanged; ensuring the model provides reliable prediction results across various scenarios; specifically including:
[0084] S1: Load the pre-trained model;
[0085] S2: Select layer freezing strategy;
[0086] 1) The preprocessing part is responsible for the initial decomposition of the data, that is, decomposing the time data into seasonal components and trend components. This layer has been deeply adapted to the characteristics of the original data. When a small amount of data is migrated, in order to maintain its adaptability to the characteristics of the original data, no adjustment is made. This layer is frozen by setting requires_grad=False.
[0087] 2) The embedding layer (enc_embedding) is responsible for processing the embedding of the input data, including location embedding and temporal feature embedding. Given the similarity between the temporal features of the new data and the original training data, this layer is frozen by setting requirements_grad=False to maintain the embedding patterns learned under the original data training.
[0088] 3) The pdm_blocks module is responsible for processing seasonal and trend component information at different frequencies. Within each block, the down_sampling_layers and up_sampling_layers are responsible for extracting and fusing multi-frequency features. During the training process on the original data, this module already possessed efficient feature extraction and fusion capabilities. Therefore, in transfer learning, this module was frozen by setting requires_grad=False to maintain its original feature processing capabilities on the new data.
[0089] S3: Trainable layer settings; the prediction layers and projection layers directly output the prediction results, and these two layers are closely related to the specific task. Furthermore, they can still be trained relatively quickly even with small amounts of data or limited computational resources. During transfer learning, setting `requires_grad = True` for these two layers makes their parameters trainable, thereby readjusting them to the target distribution of new data.
[0090] By setting the `requires_grad` attribute as described above, only the relevant layers that do not require adjustment are frozen, and only the parameters of the `predict_layers` and `projection_layer` layers are retrained. This fully leverages the powerful feature extraction capabilities learned by the pre-trained model on large-scale data. This approach ensures that the model provides reliable and accurate prediction results in various complex scenarios, effectively improving the model's generalization performance.
[0091] The beneficial effects of this invention are as follows: This invention utilizes the WaveMixer model to achieve high-precision prediction of lithium battery SOC, providing a powerful critical state monitoring capability for battery management systems. This includes using sensors and data acquisition equipment to collect data on the key characteristics of specific batteries; cleaning the data to remove outliers and noise interference, ensuring it meets model input requirements; inputting the preprocessed data into the WaveMixer model, where a multi-layered mixing mechanism within the model fuses and analyzes data from different frequencies, thereby outputting a high-precision SOC prediction result; and by integrating transfer learning into the prediction model, for other battery types, extensive repetitive training from scratch is unnecessary. Model adaptation can be quickly achieved by fine-tuning with a small amount of target battery data based on existing model parameters, significantly reducing the cost of repetitive model training and efficiently meeting the prediction needs of lithium battery SOC. In applications such as electric vehicles and energy storage systems, this invention can provide real-time and accurate assessment of remaining battery power, helping users plan their trips and power usage more rationally, effectively avoiding unexpected situations caused by inaccurate power estimation, and meeting the need for precise battery power control in practical use. Attached Figure Description
[0092] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0093] Figure 1 This is a schematic diagram of a lithium battery SOC prediction method based on the WaveMixer model provided in Embodiment 1 of the present invention;
[0094] Figure 2 This is a schematic diagram of the framework structure of a lithium battery SOC prediction model based on the WaveMixer model provided in Embodiment 1 of the present invention.
[0095] Figure 3 This is a schematic diagram of a portion of the lithium battery SOC dataset provided in Embodiment 2 of the present invention;
[0096] Figure 4 This is a partial test data comparison diagram of the lithium battery SOC prediction model based on the WaveMixer model provided in Embodiment 2 of the present invention.
[0097] Figure 5 This is a schematic diagram of the transfer learning effect of the pre-trained model of the lithium battery SOC prediction model based on the WaveMixer model provided in Embodiment 2 of the present invention.
[0098] Figure 6 This is a schematic diagram illustrating the direct training effect of the lithium battery SOC prediction model based on the WaveMixer model provided in Embodiment 2 of the present invention.
[0099] Figure 7 This is a schematic diagram comparing the convergence effect of the transfer learning loss curve of the lithium battery SOC prediction model based on the WaveMixer model provided in Embodiment 2 of the present invention. Detailed Implementation
[0100] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0101] Example 1
[0102] This embodiment provides a lithium battery SOC prediction method based on the WaveMixer model, and its flowchart is shown below. Figure 1 As shown, the operations include the following:
[0103] S1: Collect historical characteristic data of lithium batteries, specifically including:
[0104] Battery State of Charge (SOC), Pack Voltage, Charge Current, Max Cell Voltage, Min Cell Voltage, Max Temperature, Min Temperature, Available Energy, and Available Capacity.
[0105] S2: Constructing a lithium battery SOC prediction model based on WaveMixer:
[0106] (1) Data preparation and preprocessing: The historical feature data obtained in S1 is organized according to time to form a complete dataset; the first 84% of the data is taken as the main dataset and the last 16% of the data is taken as the transfer learning dataset; the feature values are unified and the multiple different lithium battery data files are merged; the main dataset is divided into training set, validation set and test set, with the ratio of training set, validation set and test set being 7:1:2; to evaluate the performance and accuracy of the water level prediction model.
[0107] (2) Establishment of lithium battery SOC model based on WaveMixer: Under the PyTorch framework, establish a lithium battery SOC prediction model based on WaveMixer.
[0108] like Figure 2 As shown, the WaveMixer model employs a multi-frequency hybrid architecture to address complex temporal variations in time-based data prediction. This model primarily utilizes an MLP architecture, consisting of an adaptive multi-level discrete wavelet decomposition module, a past decomposable hybrid module, and a future multi-predictor hybrid module. This structure enables it to efficiently leverage multi-frequency data information.
[0109] The multi-level discrete adaptive wavelet decomposition module employs a multi-level discrete decomposition method, using a periodic extension mode to address boundary effect problems. Based on the characteristics of the input data, this module matches the optimal basis function from the wavelet basis functions and determines the appropriate wavelet decomposition level. Available wavelet basis functions include Daubechies, Symlets, Coiflets, Biorthogonal, and Haar wavelet basis functions.
[0110] The module first performs a multi-level decomposition operation with a decomposition level of 3 on the input data signal:
[0111] coeffs=wavelet_dec(signal,level=3)
[0112] Subsequently, signal reconstruction is performed based on the coefficients coeffs obtained after decomposition:
[0113] re_signal=wavelet_rec(coeffs)
[0114] By comparing the input data signal with the reconstructed data re_signal, the correlation coefficient matrix corresponding to the currently selected wavelet basis function is calculated:
[0115] corr=corrcoef(signal,re_signal)[0,1]
[0116] Where: corrcoef is the Pearson correlation coefficient matrix, and its expression is:
[0117]
[0118] Among them, signal i Represents the i-th input data; re_signal i Represents the i-th reconstructed data; This represents the average value of the input data; This represents the average value of the reconstructed data;
[0119] Then, the correlation coefficient between the first and second elements in the matrix is extracted, and the wavelet basis function with the largest correlation coefficient is selected dynamically and determined as the optimal basis function.
[0120] By combining the input data signal and the sampling frequency fs, the autocorrelation function Mulcor of the input data is calculated using multiple autocorrelation analysis; through multiple calculations, the inherent periodic characteristics of the data are enhanced.
[0121] Mulcor=correlate(signal,signal)
[0122] Wherein: `correlate` is used to calculate the cross-correlation between two one-dimensional data points. Its expression is:
[0123]
[0124] Where 'a' represents the input data. Indicates a n The complex conjugate of , where n represents the length of the input data and q represents the index offset;
[0125] The processed autocorrelation function is subjected to a Fourier transform (FFT). During this process, the frequency axis (freq) is accurately calculated, and the frequency with the largest amplitude is extracted as the dominant frequency (MainFreq).
[0126] MainFreq=freq{k}
[0127] Where k = argmax(|FFT(Mulcor)|), represents the frequency index, and argmax(|FFT(Mulcor)|) is the index of |FFT(Mulcor)|;
[0128] in:
[0129]
[0130] Where k is the frequency index, n is the length of the input data, and j represents the imaginary unit;
[0131] Based on the length n of the input data and the filter length flter_len of the selected wavelet basis, the maximum theoretical number of levels max_level is calculated:
[0132]
[0133] At the same time, the layer number ideal_level is calculated, and its expression is:
[0134]
[0135] Ultimately, the module will return the minimum value.
[0136] min(ideal_level-1, max_level)
[0137] As the actual number of decomposition levels;
[0138] The past decomposable mixing module extracts past information and mixes seasonal and trend components at different frequencies separately. The future multi-predictor mixing module improves the prediction accuracy of future data by integrating multiple predictors, each predicting based on information at different frequencies.
[0139] For past observation data x∈R P×C Downsampling is performed, and the set of multi-frequency data χ={x0,…,x M},in, P represents the prediction window length, C represents the number of variables, m represents the number of wavelet decomposition levels, and M represents the maximum number of levels.
[0140] Projecting these multi-frequency data into the embedding layer yields deep features χ. 0 It can be formalized as:
[0141] χ 0 =Embed(χ)
[0142] Here, Embed(·) represents the embedding layer, thus obtaining the multi-frequency representation of the input data; stacked past decomposable mixing modules are used to mix past information of different frequencies. For the l-th layer past decomposable mixing module, the input is χ. l-1 Furthermore, the process of decomposing hybrid modules in the past can be formulated as follows:
[0143] χ l =PDM(χ) l-1 ), l∈{0,…,L}
[0144] Where L is the total number of layers in the previously decomposable hybrid modules, and l represents one of the layers, and Where, d model The number of channels indicates the representation of the past.
[0145] In the future prediction phase, a multi-predictor hybrid module is used to integrate multi-frequency past information χ. L And generate future predictions, namely:
[0146]
[0147] in F represents the number of time steps in the final future prediction. Represents the final prediction;
[0148] Through the above design, WaveMixer can effectively capture key information from the unraveled multi-frequency observations, achieve accurate predictions of the future, and fully leverage the advantages of multi-frequency information.
[0149] The past decomposable mixing module mixes the decomposed seasonal components and trend components into multiple frequencies through past decomposition and mixing. For the l-th past decomposable mixing module;
[0150] First, the multi-frequency time data of the l-th layer χ l Decomposed into seasonal components and trend components
[0151] in, The seasonal and trend component terms are mixed to allow them to interact with information from multiple frequencies.
[0152] The l-th past decomposable hybrid module can be represented as:
[0153]
[0154] SoftShrink() is the soft thresholding function, and the processing procedure is as follows:
[0155]
[0156] Where threshold is the processing threshold and θ is the parameter to be processed;
[0157] X l =X l-1 +FeedForward(SeasonMix(s l )+TrendMix(t l ))
[0158] Among them, t l Represents the trend component, s l Representing seasonal components, χ l χ represents the output of the current and past decomposable hybrid module. l-1 The output of the previous decomposable mixing module is represented by WaveletDecomp(·), which represents the data decomposition module. FeedForward(·) contains two linear layers with a GELU activation function in between for information interaction between channels. SeasonMix(·) and TrendMix(·) represent seasonal component mixing and trend component mixing, respectively.
[0159] In terms of seasonal component mixing, a bottom-up approach is adopted to incorporate information from low-level fine-frequency data, thereby supplementing detailed information for coarse-frequency seasonal component modeling. A bottom-up mixing layer is used to achieve bottom-up interaction of seasonal component information in the m-th layer using residuals.
[0160] For m∶1→M:
[0161] Do
[0162] Bottom-Up-Mixing(·) is instantiated as two linear layers with intermediate GELU activation functions, and its input dimension is along the time dimension. The output dimension is
[0163] For trend components Starting with the coarsest frequency, macroscopic information is gradually transmitted to finer frequencies. A top-down hybrid layer is used to achieve top-down trend information interaction in a residual manner at the m-th layer:
[0164] For m∶(M-1)→0:
[0165] Do
[0166] Here, Top-Down-Mixing(·) consists of two linear layers with intermediate GELU activation functions, and its input dimension is... The output dimension is
[0167] By leveraging the blending of seasonal and trend components, the previously decomposable blending module gradually aggregates detailed seasonal component information from fine to coarse, and integrates macro trend component information with prior knowledge, ultimately achieving multi-frequency blending in past information extraction.
[0168] After passing through the L-layer decomposable hybrid module, the multi-frequency past information is obtained, represented as:
[0169]
[0170] Because data from different frequencies exhibit different dominant changes, their predictive capabilities also vary.
[0171]
[0172] in, Predictor represents future predictions from the data at level m. m (·) refers to the predictor for the m-th layer of data, and the final output is This represents the future prediction results for all layers.
[0173] S3: Training and evaluation of the lithium battery SOC prediction model:
[0174] Training and Validation: The lithium battery SOC prediction model will be trained and validated on the top 84% of the data in the main dataset. By comparing with real SOC data, the lithium battery SOC prediction model will gradually optimize its weights and parameters to improve its prediction accuracy.
[0175] Testing and Evaluation: The performance of the trained and validated lithium battery SOC prediction model was evaluated using a test dataset to determine its generalization ability and prediction accuracy for future data.
[0176] S4: Bayesian optimization is used to optimize the hyperparameters of the model. A surrogate model is built using the optuna library to approximate the objective function. This surrogate model can model the objective function based on existing observation data and provide the probability distribution of the objective function value under different parameter combinations. In each iteration, Bayesian optimization selects the parameter point most likely to achieve a better value for the objective function based on the prediction results of the surrogate model and the uncertainty estimate for the next evaluation. Through continuous iteration, the optimal parameter combination is gradually approximated, reducing unnecessary parameter search computation and improving model performance.
[0177] S5: Perform transfer learning training on the lithium battery SOC prediction model: Load the pre-trained model and freeze all layers to keep their weights unchanged, thereby leveraging the feature extraction capabilities learned by the pre-trained model on large-scale data. This freezing is achieved by setting the `requires_grad` attribute. Ensure that the parameters of the last layer can be updated. Retrain the model using a new dataset, updating only the weights of the last layer while keeping the weights of other layers unchanged. This further improves the model's generalization ability, ensuring that the model can provide reliable prediction results in various scenarios.
[0178] Example 2
[0179] This embodiment provides a lithium battery SOC prediction method based on the WaveMixer model. This method predicts the state of charge of lithium batteries based on the prediction method provided in Embodiment 1.
[0180] Step 1: Collect historical characteristic data of lithium batteries, specifically including:
[0181] Battery State of Charge (SOC), Pack Voltage, Charge Current, Max Cell Voltage, Min Cell Voltage, Max Temperature, Min Temperature, Available Energy, and Available Capacity.
[0182] Specific lithium battery SOC datasets, such as Figure 3 As shown.
[0183] Step 2: Input the collected data into the lithium battery SOC prediction model based on the WaveMixer model for prediction.
[0184] The lithium battery SOC prediction model was iteratively trained using the complete lithium battery SOC training dataset according to the specific implementation process described above. The resulting test results (rounded to four decimal places) are as follows: Mean Squared Error (MSE): 0.5144, Mean Absolute Error (MAE): 0.3205, Root Mean Squared Error (RMSE): 0.7173. The partial test results for the last 20% of the test dataset in the main dataset are as follows: Figure 4 As shown, the actual SOC data curve and the predicted SOC data curve basically overlap, indicating that the prediction results of the lithium battery SOC prediction model based on the WaveMixer model proposed in this invention have extremely high accuracy. Based on the pre-trained model, a transfer learning strategy is adopted to make full use of the powerful feature extraction capability learned by the pre-trained model on large-scale data, ensuring that the model can provide reliable and accurate prediction results in various complex scenarios and improve the generalization performance of the model.
[0185] This embodiment uses the pre-trained model obtained from the above steps and performs transfer learning training using a transfer learning dataset. Some metrics of the transfer learning training (rounded to four decimal places) are: Mean Squared Error (MSE): 0.6599, Mean Absolute Error (MAE): 0.3689, Root Mean Squared Error (RMSE): 0.8123. An overall prediction performance diagram is shown below. Figure 5 As shown in the figure, the true value curve and the predicted value curve almost overlap, indicating that the lithium battery SOC prediction model based on the WaveMixer model proposed in this invention has good prediction performance. Furthermore, some metrics (rounded to four decimal places) trained using the same dataset and hyperparameters without transfer learning are as follows: Mean Squared Error (MSE): 0.6444, Mean Absolute Error (MAE): 0.4092, Root Mean Square Error (RMSE): 0.8027. The overall prediction performance is as follows. Figure 6 As shown in the figure; comparing the two figures, the predicted curve and the actual curve of transfer learning almost overlap, while the two curves obtained by directly using a small dataset do not match well in some areas. It can be seen that the effect of transfer learning is better than training directly using a small dataset.
[0186] The loss curves based on transfer learning strategies and direct training are as follows: Figure 7 As shown, the training loss curve and validation loss curve are included. Under training with a small number of rounds and the same hyperparameters, the loss based on the transfer learning strategy converges quickly and achieves good accuracy, while the direct training process converges more slowly.
[0187] Based on this, this task domain does not require extensive repetitive training from scratch. It can quickly achieve model adaptation by fine-tuning with a small amount of target battery data based on existing model parameters, which greatly reduces the cost of repetitive model training and meets the prediction requirements for lithium battery SOC.
[0188] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A lithium battery SOC prediction method based on the WaveMixer model, characterized in that, The method includes: Step S1: Collect the feature values of lithium batteries in the T-period before prediction; organize the collected data in chronological order to form a complete lithium battery dataset and divide it into a main dataset and a transfer learning dataset. Divide the main dataset into a training set, a validation set and a test set. Step S2: Construct a lithium battery SOC prediction model based on the WaveMixer model; Step S3: Use the training set from step S1 to train the lithium battery SOC prediction model based on the WaveMixer model constructed in step S2. Step S4: Use Bayesian optimization to optimize the parameters of the lithium battery SOC prediction model based on the WaveMixer model trained in Step S3; Step S5: Employ a transfer learning strategy and retrain the lithium battery SOC prediction model based on the WaveMixer model optimized in Step S4 using the transfer learning dataset. Step S6: Input the data to be predicted into the lithium battery SOC prediction model based on the WaveMixer model after retraining in step S5 to predict the state of charge of the lithium battery. The lithium battery SOC prediction model based on the WaveMixer model in step S2 includes an adaptive multi-level discrete wavelet decomposition module, a past decomposable hybrid module, and a future multi-predictor hybrid module. The adaptive multi-level discrete wavelet decomposition module processes the input information using a multi-level discrete decomposition method and a periodic extension mode to determine the wavelet basis function and the number of wavelet decomposition levels. The past decomposable mixing module decomposes the information processed by wavelet basis functions into seasonal components and trend components through past decomposition and mixing, and then mixes the seasonal components and trend components respectively to obtain the multi-frequency mixture in the past information. The future multi-predictor hybrid module predicts past information at different frequencies by integrating predictors.
2. The method according to claim 1, characterized in that, The adaptive multi-level discrete wavelet decomposition module processes the input data as follows: The processing of the adaptive multi-level discrete wavelet decomposition module is divided into two parts; In the first part, the input data is decomposed and reconstructed. By comparing the input data and the reconstructed data, the correlation coefficient matrix of the current wavelet basis function is calculated. The correlation coefficient between the first and second elements of the matrix is extracted, and the wavelet basis function with the largest correlation coefficient is dynamically selected as the best basis function. In the second part, the autocorrelation function of the input data is calculated by combining the input data and the sampling frequency, and Fourier transform is performed. The frequency axis is calculated and the maximum frequency is selected as the dominant frequency. The maximum number of wavelet basis functions is calculated by the length of the input data and the filter length of the optimal basis function. The actual number of layers is obtained by frequency band division.
3. The method according to claim 2, characterized in that, The processing procedure of the input data by the previously decomposable mixing module includes: Past observation data Downsampling is performed, and the set of multi-frequency data is obtained by using the wavelet basis functions determined by the adaptive multi-level discrete wavelet decomposition module and the level transformation decomposition. ,in, Representative has lines and The real vector space of columns, , Represents the prediction window length. Indicates the number of variables. This represents the number of layers in the wavelet decomposition. The maximum value representing the number of layers; Projecting these multi-frequency data into the embedding layer yields deep features. Its expression is: in, Representing the embedding layer, a multi-frequency representation of the input data is obtained; stacked past decomposable mixing modules are used to mix past information of different frequencies, for the . The layer can be decomposed into a hybrid module, and the input is Furthermore, the process of decomposing hybrid modules in the past can be formulated as follows: in, It is the total number of layers of the previously decomposable hybrid modules. Represents one of the layers, and ,in, The number of channels indicates the past representation of the mixture.
4. The method according to claim 3, characterized in that: The future multi-predictor hybrid module integrates multi-frequency data from past decomposable hybrid modules. And generate future predictions, namely: in F represents the number of time steps in the final future prediction. This represents the final prediction.
5. The method according to claim 4, characterized in that, The mixing process of seasonal and trend components in the previously decomposable mixing module includes: For seasonal component mixing, a bottom-up mixing layer is used to achieve bottom-up interaction of seasonal components in a residual manner. For trend component mixing, a top-down mixing layer is used to achieve top-down interaction of trend components in a residual manner.
6. The method according to claim 5, characterized in that, The evaluation parameters used in the training and evaluation in step S3 include: mean square error, mean absolute error, and root mean square error. The prediction model performs best when the mean square error, mean absolute error, and root mean square error are all less than 1%.
7. The method according to claim 6, characterized in that, The evaluation and parameter optimization in step S4 include: The optuna library is used to implement Bayesian optimization. A TPE method based on kernel density estimation is constructed as the approximate objective function of the surrogate model, and the probability distribution of the objective function value under different parameter combinations is given. The parameter point corresponding to the current maximum expected value is selected for the next evaluation based on the prediction results of the surrogate model. The optimal parameter combination is gradually approximated.
8. The method according to claim 7, characterized in that, The retraining in step S5 includes: Load the pre-trained model; freeze all layers to keep the weights of the frozen layers unchanged; set the parameters of the last layer so they can be updated; retrain the model using the transfer learning dataset to update the weights of the last layer.
9. The method according to claim 8, characterized in that, The characteristic values of the lithium battery collected in step S1 during the T-period before prediction include: battery state of charge, battery pack voltage, charging current, maximum single-cell voltage, minimum single-cell voltage, highest temperature, lowest temperature, available energy, and available capacity. In step S1, the ratio of the main dataset to the transfer learning dataset is 0.84:0.16; the ratio of the training set, validation set, and test set in the main dataset is 7:1:2.