Liquid metal battery capacity prediction method, system and equipment based on Stacking model and medium
By integrating multiple machine learning models such as gradient boosting decision tree, random forest, and support vector regression through the stacking model, the problem of unstable accuracy of a single model in the capacity prediction of liquid metal batteries is solved, and high-precision and high-stability capacity prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU POWER GRID CO LTD
- Filing Date
- 2025-11-28
- Publication Date
- 2026-05-05
AI Technical Summary
Existing methods for predicting the capacity of liquid metal batteries rely on a single machine learning model, which leads to insufficient prediction accuracy and an inability to fully capture battery aging characteristics, thus affecting the accuracy and reliability of capacity prediction.
A stacking model is adopted, combining gradient boosting decision tree, random forest and support vector regression as base learners, and linear regression as meta learner. A hierarchical prediction model is constructed through the stacking ensemble method, and historical capacity data of liquid metal batteries are used for training and prediction.
It significantly improves the accuracy and stability of capacity prediction for liquid metal batteries, enabling a more comprehensive capture of aging characteristics and achieving high-precision capacity prediction.
Smart Images

Figure CN121980896A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy storage battery capacity prediction technology, and in particular to a method, system, device and medium for predicting the capacity of liquid metal batteries based on a stacking model. Background Technology
[0002] In recent years, with the increasing severity of environmental pollution and the depletion of fossil fuels, the development of clean energy and the research and application of efficient energy storage technologies have become particularly important. As a key hub connecting energy production and consumption, the performance of energy storage systems directly determines the feasibility and economic viability of large-scale grid integration of renewable energy. Among numerous energy storage technologies, liquid metal batteries, due to their unique structural design and excellent performance, are gradually becoming a strong competitor in the next generation of electrochemical energy storage technologies, demonstrating broad application prospects. Liquid metal batteries typically consist of a liquid metal anode, a liquid alloy cathode, and an intermediate molten salt electrolyte. These three components remain liquid at operating temperatures and naturally separate into three layers due to density differences and immiscibility, forming a stable liquid-liquid-liquid three-layer structure. This all-liquid structure not only makes the battery interface smoother and the reaction kinetics faster, but also avoids the structural degradation mechanisms common in traditional solid-state electrodes, such as active material shedding, volume expansion, and lithium dendrite growth, thereby significantly improving the battery's cycle life and safety performance. Furthermore, due to its highly adaptable structure to the manufacturing process, liquid metal batteries also have significant advantages in single-cell manufacturing and modular assembly. In actual battery operation, capacity, as a core indicator of battery performance and health, reflects changes in various internal mechanisms such as electrochemical reaction efficiency, interface stability, and material loss. Especially in the long-term operation of liquid metal batteries, although the microscopic destructive mechanisms of solid electrodes are absent, they are still affected by factors such as material interdiffusion, corrosion, and electrolyte composition evolution, leading to slow capacity decay. Therefore, accurately predicting future battery capacity changes is crucial for ensuring stable service and improving system operating efficiency. Capacity prediction not only enables dynamic assessment of battery health and early warning of fault trends but also provides key support for intelligent scheduling, operation and maintenance, and lifespan management of energy storage systems. With the widespread application of liquid metal batteries in areas such as power peak shaving and renewable energy integration, constructing high-precision and robust capacity prediction models will become one of the important research directions in their engineering applications.
[0003] Capacity prediction methods are mainly divided into model-based methods and data-driven methods. Traditional model-based methods primarily obtain battery aging characteristic parameters through empirical models, electrochemical models, and equivalent circuit models, and then combine them with methods such as Kalman filtering and particle filtering to predict battery capacity. Model-based health state estimation methods have the advantages of strong physical interpretability and low data requirements, but they are complex to model, computationally expensive, and difficult to obtain model parameters. Their adaptability to actual operating conditions is limited, and they may lead to increased estimation errors in dynamic or extreme environments. Data-driven methods are mainly divided into predictions based on health factors and predictions based on historical capacity trajectories. The first type of method analyzes experimental data from battery cycling, extracts health factors with aging characteristics, and then inputs them into machine learning models such as Gaussian process regression to obtain battery capacity prediction results. This type of method requires real-time acquisition of battery experimental data, has high data requirements, and is not easy to implement. The second type of method only requires historical battery capacity data, and can achieve future capacity prediction by combining it with a machine learning model, making it easier to implement. However, current research mainly relies on single machine learning models. Although these models, due to their relatively simple structure, can achieve good prediction accuracy in certain specific application scenarios, their applicability still has certain limitations. Different machine learning models differ in their assumptions, learning mechanisms, and data processing methods, thus failing to fully capture the aging characteristics of batteries. This can lead to instability in prediction accuracy, thereby affecting the reliability and accuracy of capacity prediction.
[0004] Therefore, this invention analyzes the characteristics of different machine learning models, selects Gradient Boosting Decision Tree (GBDT), Random Forest (RF), and Support Vector Regression (SVR) as base learners, and Linear Regression (LR) as meta learners. It then uses the Stacking ensemble method to stack multiple models, constructing a liquid metal battery capacity prediction method based on the Stacking model. This fully leverages the advantages of different machine learning models, laying the foundation for high-precision capacity prediction. Summary of the Invention
[0005] In view of the above-mentioned existing problems, the present invention provides a method, system, device and medium for predicting the capacity of liquid metal batteries based on a stacking model.
[0006] Therefore, the technical problem solved by this invention is to overcome the problem of insufficient prediction accuracy caused by the use of a single machine learning model in the existing data-driven methods. This invention proposes a liquid metal battery capacity prediction method based on a stacking model. By analyzing the characteristics of historical capacity data of liquid metal batteries, multiple machine learning models are selected and stacked using the stacking ensemble method to achieve high-precision and efficient prediction of liquid metal battery capacity.
[0007] To solve the above technical problems, the present invention provides the following technical solution: a liquid metal battery capacity prediction method based on a stacking model, comprising: selecting gradient boosting decision tree, random forest and support vector regression as base learners, and selecting linear regression as a meta-learner; Based on the Stacking ensemble learning method, the prediction output of the base learner is used as a new feature input to train the meta learner and construct a hierarchical stacked prediction model. We conducted aging experiments on liquid metal batteries to obtain historical capacity decay data of the batteries during cyclic charging and discharging, forming a dataset for model training and testing. The historical capacity data training set is divided into multiple data subsets by using a cross-partitioning method. The base learner is trained sequentially using these data subsets, and the prediction results of the base learner on the corresponding test subsets are combined into a new training dataset to train the meta learner. The historical capacity data of the liquid metal battery to be predicted is input into the trained stacked model. The base learner generates a preliminary prediction result, which is then integrated by the meta learner to output the predicted value of the future capacity of the battery.
[0008] As a preferred embodiment of the liquid metal battery capacity prediction method based on the Stacking model described in this invention, the cross-partitioning of data includes dividing the overall training set into k data subsets with the same amount of data. One subset of data is used as the test set for the base learner, and the remaining k-1 subsets are used as the training set. Each base learner is trained to obtain k models for each base learner. Each test subset is input into the corresponding base learner model, and the prediction results are combined into a new feature dataset for training the meta-learner.
[0009] As a preferred embodiment of the liquid metal battery capacity prediction method based on the Stacking model described in this invention, the stacking model includes inputting the feature data of the test set into k models corresponding to each base learner, and obtaining k sets of prediction results for each base learner. The k prediction results of the same base learner are averaged to obtain the final primary prediction output of each base learner. The final primary prediction outputs of each base learner are combined into a feature vector, which is then input into the trained meta-learner to obtain the final capacity prediction result.
[0010] As a preferred embodiment of the liquid metal battery capacity prediction method based on the Stacking model described in this invention, the gradient boosting decision tree includes: constructing a decision tree by using the gradient boosting idea and a sequential method, wherein each subsequent tree is trained based on the prediction residual of the previous tree, gradually minimizing the loss function, and capturing the complex nonlinear trend in the capacity decay data. The random forest includes constructing decision trees through a parallel ensemble method using Bagging. Each tree is trained using randomly sampled samples with replacement and a subset of features from the training set, and the prediction results of all trees are averaged. The support vector regression includes mapping the input data to a high-dimensional feature space and constructing a regression function, balancing model complexity and prediction error during the optimization process, and handling high-dimensional nonlinear data relationships.
[0011] As a preferred embodiment of the liquid metal battery capacity prediction method based on the Stacking model described in this invention, the step of selecting linear regression as the meta-learner includes receiving a feature vector composed of the final primary prediction outputs of each base learner, solving for the weight parameters and bias terms using the least squares method, learning and linearly combining the prediction advantages of the base learners, and generating the final stacking model prediction output.
[0012] As a preferred embodiment of the liquid metal battery capacity prediction method based on the Stacking model described in this invention, the step of inputting the historical capacity data of the liquid metal battery to be predicted into the trained stacking model includes a continuous capacity data sequence starting from a starting cycle number q and ending at another cycle number m+q, wherein the sequence defines a time window for predicting future capacity. The output of future capacity data is a continuous capacity data sequence starting from the cycle number m+q+1 and ending at the cycle number m+q+n. The sequence defines the future time span to be predicted.
[0013] As a preferred embodiment of the liquid metal battery capacity prediction method based on the Stacking model described in this invention, in the model prediction stage, when averaging the k sets of prediction results for each base learner, the arithmetic mean method is adopted. By summing the k output values and dividing by k, a stable and representative primary prediction output of the base learner is obtained.
[0014] This invention provides a liquid metal battery capacity prediction system based on a stacking model.
[0015] As a preferred embodiment of the liquid metal battery capacity prediction system based on the Stacking model described in this invention, it includes a data management module, a model building module, a training engine, and a prediction engine. The data management module is used to receive, store and preprocess historical capacity data obtained from the aging experiment of liquid metal batteries, and divide it into training set and test set to provide data support for model training and prediction. The model building module is used to configure the structure of the stacked model, including specifying gradient boosting decision tree, random forest and support vector regression as base learners, specifying linear regression as meta learner, and defining the logical flow of stacking ensemble learning. The training engine, connected to the data management module and the model building module, is used to execute the model training process. It trains the base learner by calling the method of cross-partitioning data, and uses the output of the base learner to build a new training feature set to train the meta learner, and finally generates a usable stacked prediction model. The prediction engine, connected to the data management module and the training engine, is used to load the final stacked model generated by the training engine, receive the historical capacity data of the battery to be predicted, coordinate the base learner to perform primary prediction, call the meta learner to integrate the results, and finally output the future capacity prediction sequence.
[0016] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of a liquid metal battery capacity prediction method based on a stacking model.
[0017] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of a method for predicting the capacity of a liquid metal battery based on a stacking model.
[0018] The beneficial effects of this invention are: it fully leverages the advantages of the selected basic model and effectively integrates the sensitivity of different models to the aging characteristics of liquid metal batteries. More importantly, by comprehensively capturing aging characteristics, it significantly improves the accuracy of liquid metal battery capacity prediction. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the 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.
[0020] Figure 1 This is a schematic diagram of a liquid metal battery capacity prediction method based on a stacking model, provided as an embodiment of the present invention.
[0021] Figure 2 The flowchart shows the RUL prediction method model training process of a liquid metal battery capacity prediction method based on a stacking model, as provided in an embodiment of the present invention.
[0022] Figure 3 The flowchart of the RUL prediction method model for a liquid metal battery capacity prediction method based on a stacking model provided in an embodiment of the present invention is shown.
[0023] Figure 4 The diagram shows the RUL prediction results of a liquid metal battery capacity prediction method based on a stacking model provided in an embodiment of the present invention. Detailed Implementation
[0024] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0025] Example 1, referring to Figure 1 This is the first embodiment of the present invention, which provides a method for predicting the capacity of liquid metal batteries based on a stacking model, including: S1: GBDT, RF, and SVR are selected as base learners, and LR is selected as meta learner.
[0026] S2: Construct a stacking model based on the Stacking integration method.
[0027] S3: Conduct aging experiments on liquid metal batteries to obtain historical capacity data.
[0028] S4: Predict the future capacity of the liquid metal battery using the stacking model and the historical capacity data.
[0029] It should be noted that, in order to address the technical bottlenecks of existing liquid metal battery capacity prediction methods, model-based schemes are complex and have poor adaptability, while data-driven methods rely on a single machine learning model, which leads to the inability to fully capture complex aging characteristics and limited and unstable prediction accuracy. Therefore, a fusion prediction scheme based on a stacking model is proposed.
[0030] By integrating multiple heterogeneous learners such as gradient boosting decision trees, random forests, and support vector regression as base models, and using a linear regression meta-model for fusion, the limitations of a single model are effectively overcome. This approach can more comprehensively and robustly extract and learn aging patterns from historical capacity data with fluctuating decay, thereby significantly improving the accuracy and reliability of capacity prediction.
[0031] Example 2, refer to Figures 2-4 As an embodiment of the present invention, based on the above embodiment, a method for predicting the capacity of liquid metal batteries based on a stacking model is provided.
[0032] Furthermore, in this embodiment of the application, step S1 selects GBDT, RF, and SVR as base learners and LR as meta learner, specifically including steps S101-S104: S101: GBDT is a sequential ensemble method based on Boosting. It employs the gradient boosting concept to optimize the model's predictive performance by progressively building decision trees. During training, GBDT builds decision trees as sub-models, each optimized based on the residuals of the previous sub-model. This is achieved by gradually minimizing the loss function through negative gradient descent. Finally, the results from different sub-models are combined additively to improve the overall predictive performance of the model. This process effectively corrects the prediction errors of the previous model, continuously improving its accuracy. It is particularly suitable for handling high-dimensional data and capturing complex nonlinear relationships.
[0033] The regression prediction result of the algorithm is obtained iteratively from the initial predicted value and the weighted output of multiple decision trees. Specifically, for n m-dimensional input features x, after M iterations, the prediction output result is shown in equation (1): (1) in, x i For the model's first i One input feature vector; F M ( x i ) is the model's first i One predicted output value; F 0 represents the initial prediction value of the model, which is usually the mean of the labels in the training set;h m ( x i ) is the first m In the nth iteration, the decision tree... i One output value; η The learning rate represents the weight of each decision tree's contribution to the final model; M The total number of iterations represents the number of decision trees.
[0034] S102: Unlike GBDT, RF is a parallel ensemble method based on Bagging. During training, multiple decision trees are constructed as sub-models. Training data is then randomly sampled with replacement, and each tree is trained independently. Finally, the predictions of all sub-models are averaged to obtain the final output. Due to its randomness and the independence of each decision tree, RF effectively avoids overfitting. The specific steps are: extracting the training set, constructing decision trees, and ensemble prediction.
[0035] S103: SVR is an extension of Support Vector Machine (SVM) for regression tasks. It predicts the target variable by constructing a linear or nonlinear model and balances model complexity and prediction error during optimization. The goal of SVR is to find a regression function f(x) such that the prediction error for most training samples is within an acceptable range ε. For a given input x, the SVR model is shown in the following equation: (2) Where ϕ(x) is a nonlinear transformation that maps the input to a high-dimensional feature space; ω is a weight vector that determines the direction of the model; and b is a bias term.
[0036] All three data-driven models are capable of high-precision regression prediction analysis, making them suitable as base learners. Each model has its unique advantages. GBDT optimizes the model's predictive ability by progressively correcting residuals, performing exceptionally well, especially when handling high-dimensional data, but it also carries the risk of overfitting. In contrast, RF is more robust in handling complex data patterns, noise, and feature importance assessment, effectively addressing data uncertainty. SVR excels in handling high-dimensional nonlinear data and avoiding overfitting; although its prediction accuracy is relatively lower than GBDT, its good generalization ability and resistance to overfitting give it an advantage in complex problems.
[0037] In an alternative embodiment, the base learner may also choose to adaptively boost AdaBoost, specifically a sequence ensemble method based on the Boosting framework, which gradually improves model performance by adjusting the weights of erroneous samples.
[0038] In another alternative embodiment, the base learner may also choose a bagged decision tree, specifically by following the Bagging ensemble idea, constructing multiple decision trees through bootstrapping and averaging the results, while abandoning the feature random selection mechanism when constructing a single tree.
[0039] S104: By combining these three base learners in a stacked model, their respective advantages can be fully utilized, thereby improving the accuracy and stability of liquid metal battery capacity prediction.
[0040] Linear Regression (LR) is chosen as the meta-learner to optimize overall prediction performance by minimizing the error. Due to its simple structure, high computational efficiency, and ability to avoid overfitting, LR can accurately capture the linear relationship between the outputs of the base learners, improving the generalization ability of the Stacking model. The model is shown in the equation: (3) in, a 1. a 2. a 3 represents the weight parameters corresponding to the three base learners; x 1. x 2. x 3 represents the prediction results corresponding to the three base learners; b This is a bias term.
[0041] In an optional embodiment, the meta-learner may also choose Lasso regression, specifically by introducing an L1 regularization term that can automatically select features and compress the weights of unimportant base learner outputs to zero.
[0042] In another alternative embodiment, the meta-learner may also choose Bayesian ridge regression, specifically, estimating regression parameters using a Bayesian method, which can automatically handle multicollinearity problems and provide uncertainty estimates of the parameters.
[0043] Furthermore, in this embodiment of the application, step S2 constructs a stacking model based on the Stacking integration method, specifically including steps S201-S202: S201: This paper utilizes the Stacking ensemble method to construct a stacked model. Stacking is an ensemble learning method that uses the predictions of multiple base models as input to train a higher-level meta-model for final prediction. The basic idea is to combine the advantages of different models to improve overall prediction performance. Specifically, multiple complementary base learners are first trained; this invention selects GBDT, RF, and SVR. Then, the predictions of these models are used as new feature inputs to train a meta-learner; this invention selects LR, thereby achieving the final prediction for the original task. Stacking can effectively reduce the bias or variance of a single model and improve generalization ability.
[0044] S202: During model building, combining multiple base learners increases the overall complexity of the Stacking model. Directly training with the dataset may lead to overfitting. To fully utilize the data and avoid overfitting, a cross-split data method is used to improve the dataset before training the model. The specific steps are as follows: The training set of overall historical volume data is based on the method of cross-partitioning data. D Divided into 5 data subsets of equal size d 1. d 2. d 3. d 4. d 5.
[0045] Select a subset of data in sequence d n ( n The set of base learners (e.g., 1, 2, ..., 5) is used as the test set, and the remaining four training subsets are used as the training set. The three base learners are trained to obtain the model. M l,n ( n =1, 2,…,5; l =1,2,3), meaning the three base learners each have 5 trained models. Then... d n The corresponding features are input respectively M l,n Output t l,n Together they form a dataset with a dimension of 3. T . The dataset T The new training set features are used as input meta-learners to train the meta-learner model.
[0046] In an optional embodiment, the cross-split data can also be achieved through 3-fold cross-split, which involves dividing the training set into three subsets of equal size, using each subset as the validation set and the other two as the training set, and repeating this process three times.
[0047] In another alternative embodiment, data cross-splitting can also be achieved through hierarchical k-fold cross-splitting. Specifically, while maintaining the 5-fold split, it ensures that the label distribution of samples in each subset is consistent with the original training set. For the regression task of capacity prediction, hierarchical splitting is achieved by discretizing the capacity values into several intervals.
[0048] Furthermore, in this embodiment of the application, step S3 involves conducting an aging experiment on the liquid metal battery to obtain historical capacity data. The specific steps include: conducting an aging experiment on the liquid metal battery to obtain the aging degradation trajectory of the battery, and obtaining aging characteristics by analyzing the capacity decay data.
[0049] By using historical capacity data of liquid metal batteries as input data, future capacity data can be predicted. Specifically, the input for each set of data is the first... q The loop continues until the 1st... m + q The capacity data of each cycle [Q] his ( q ...Q his ( i + q -3), Q his ( m + q The output is the first )] m + q +1 loop to the 1st m + q + n The capacity data of each cycle [Q] his ( m + q +1)...Q his ( i + q ),Q his ( m + q +n)).
[0050] Furthermore, in this embodiment of the application, step S4 uses the stacking model and the historical capacity data to predict the future capacity of the liquid metal battery. The specific steps include: a liquid metal battery capacity prediction method based on the stacking model, which uses the historical capacity of the liquid metal battery to predict the future capacity.
[0051] The features of the test set P are input into the base learner M. l,nEach base learner can output 5 sets of prediction results, and the average of the 5 sets of results from each base learner is Q. l (l=1, 2, 3). Finally, the output of each base learner forms the input features with dimension 3, which are then input into the meta-learner to obtain the final prediction result.
[0052] In an optional embodiment, the ensemble of base learner predictions can also be achieved through a weighted average method. Specifically, based on the validation set performance of each base learner's model trained on different subsets of data, different weights are assigned to its corresponding prediction results. Models with better performance are given higher weights for their predictions, and then the weighted results are aggregated.
[0053] In another alternative embodiment, the ensemble of base learner predictions can be achieved using the median ensemble method. Specifically, the median of the five predictions from each base learner is selected as its final output. This method can effectively mitigate the interference of individual outlier predictions on the overall result.
[0054] Example 3 is the third embodiment of the present invention, which differs from the previous two embodiments in that: This embodiment also provides a liquid metal battery capacity prediction system based on a stacking model, including: a data management module, a model building module, a training engine, and a prediction engine.
[0055] The data management module is used to receive, store and preprocess historical capacity data obtained from the aging experiment of liquid metal batteries, and divide it into training set and test set to provide data support for model training and prediction. The model building module is used to configure the structure of the stacked model, including specifying gradient boosting decision tree, random forest and support vector regression as base learners, specifying linear regression as meta learner, and defining the logical flow of stacking ensemble learning. The training engine, connected to the data management module and the model building module, is used to execute the model training process. It trains the base learner by calling the method of cross-partitioning data, and uses the output of the base learner to build a new training feature set to train the meta learner, and finally generates a usable stacked prediction model. The prediction engine, connected to the data management module and the training engine, is used to load the final stacked model generated by the training engine, receive the historical capacity data of the battery to be predicted, coordinate the base learner to perform primary prediction, call the meta learner to integrate the results, and finally output the future capacity prediction sequence.
[0056] This embodiment also provides an electronic device, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the liquid metal battery capacity prediction method based on the Stacking model proposed in the above embodiment.
[0057] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the liquid metal battery capacity prediction method based on the Stacking model proposed in the above embodiments.
[0058] The storage medium proposed in this embodiment and the liquid metal battery capacity prediction method based on the stacking model proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0059] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0060] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for predicting the capacity of liquid metal batteries based on a stacking model, characterized in that: include, Gradient boosting decision tree, random forest, and support vector regression were selected as base learners, and linear regression was selected as the meta-learner. Based on the Stacking ensemble learning method, the prediction output of the base learner is used as a new feature input to train the meta learner and construct a hierarchical stacked prediction model. We conducted aging experiments on liquid metal batteries to obtain historical capacity decay data of the batteries during cyclic charging and discharging, forming a dataset for model training and testing. The historical capacity data training set is divided into multiple data subsets by using a cross-partitioning method. The base learner is trained sequentially using these data subsets, and the prediction results of the base learner on the corresponding test subsets are combined into a new training dataset to train the meta learner. The historical capacity data of the liquid metal battery to be predicted is input into the trained stacked model. The base learner generates a preliminary prediction result, which is then integrated by the meta learner to output the predicted value of the future capacity of the battery.
2. The method for predicting the capacity of liquid metal batteries based on a stacking model as described in claim 1, characterized in that: The cross-partitioning of data includes dividing the entire training set into k subsets of data with the same amount of data; One subset of data is used as the test set for the base learner, and the remaining k-1 subsets are used as the training set. Each base learner is trained to obtain k models for each base learner. Each test subset is input into the corresponding base learner model, and the prediction results are combined into a new feature dataset for training the meta-learner.
3. The method for predicting the capacity of liquid metal batteries based on a stacking model as described in claim 2, characterized in that: The stacked model includes inputting the feature data of the test set into the k models corresponding to each base learner, and obtaining k sets of prediction results for each base learner; The k prediction results of the same base learner are averaged to obtain the final primary prediction output of each base learner. The final primary prediction outputs of each base learner are combined into a feature vector, which is then input into the trained meta-learner to obtain the final capacity prediction result.
4. The method for predicting the capacity of liquid metal batteries based on a stacking model as described in claim 3, characterized in that: The gradient boosting decision tree includes the following: using the gradient boosting idea, the decision tree is constructed in a sequential manner, wherein each subsequent tree is trained based on the prediction residual of the previous tree, and the loss function is gradually minimized to capture the complex nonlinear trend in the capacity decay data; The random forest includes constructing decision trees through a parallel ensemble method using Bagging. Each tree is trained using randomly sampled samples with replacement and a subset of features from the training set, and the prediction results of all trees are averaged. The support vector regression includes mapping the input data to a high-dimensional feature space and constructing a regression function, balancing model complexity and prediction error during the optimization process, and handling high-dimensional nonlinear data relationships.
5. The liquid metal battery capacity prediction method based on the Stacking model as described in claim 4, characterized in that: The selection of linear regression as the meta-learner includes receiving a feature vector composed of the final primary prediction outputs of each base learner, solving for the weight parameters and bias terms using the least squares method, learning and linearly combining the prediction advantages of the base learners, and generating the final stacked model prediction output.
6. The method for predicting the capacity of liquid metal batteries based on a stacking model as described in claim 5, characterized in that: The step of inputting the historical capacity data of the liquid metal battery to be predicted into the trained stacked model includes a continuous capacity data sequence starting from a starting cycle number q and ending at another cycle number m+q, and the sequence defines a time window for predicting future capacity. The output of future capacity data is a continuous capacity data sequence starting from the cycle number m+q+1 and ending at the cycle number m+q+n. The sequence defines the future time span to be predicted.
7. The method for predicting the capacity of liquid metal batteries based on a stacking model as described in claim 6, characterized in that: During the model prediction phase, when averaging the k sets of prediction results for each base learner, the arithmetic mean method is used. By summing the k output values and dividing by k, a stable and representative primary prediction output of the base learner is obtained.
8. A liquid metal battery capacity prediction system based on a stacking model, employing the method for predicting liquid metal battery capacity based on a stacking model as described in any one of claims 1 to 7, characterized in that, include: Data management module, model building module, training engine, prediction engine; The data management module is used to receive, store and preprocess historical capacity data obtained from the aging experiment of liquid metal batteries, and divide it into training set and test set to provide data support for model training and prediction. The model building module is used to configure the structure of the stacked model, including specifying gradient boosting decision tree, random forest and support vector regression as base learners, specifying linear regression as meta learner, and defining the logical flow of stacking ensemble learning. The training engine, connected to the data management module and the model building module, is used to execute the model training process. It trains the base learner by calling the method of cross-partitioning data, and uses the output of the base learner to build a new training feature set to train the meta learner, and finally generates a usable stacked prediction model. The prediction engine, connected to the data management module and the training engine, is used to load the final stacked model generated by the training engine, receive the historical capacity data of the battery to be predicted, coordinate the base learner to perform primary prediction, call the meta learner to integrate the results, and finally output the future capacity prediction sequence.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the liquid metal battery capacity prediction method based on the Stacking model as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the liquid metal battery capacity prediction method based on the Stacking model as described in any one of claims 1 to 7.
Citation Information
Cited By
Battery compartment circulation efficiency prediction method, device, and medium
CN122345800A