A method and system for predicting cobalt extraction rate in a waste lithium battery solution
By introducing a comprehensive evaluation loss function into the cobalt extraction rate prediction model, and combining overfitting and accuracy evaluation terms, the hyperparameters are optimized, thus solving the overfitting problem of the cobalt extraction rate prediction method, improving the applicability and stability of the model under unknown process conditions, and enhancing the efficiency and accuracy of cobalt recovery process parameter optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CENT SOUTH UNIV
- Filing Date
- 2025-12-29
- Publication Date
- 2026-05-26
Smart Images

Figure CN122090979A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of process parameter prediction technology in the recycling of waste lithium batteries, and in particular to a model construction and optimization method for predicting the cobalt extraction rate in waste lithium battery solutions. Background Technology
[0002] Cobalt is a key component of cathode materials in lithium-ion batteries, and its efficient recovery is crucial for sustainable resource utilization. Currently, the main technology for recovering cobalt from leachate from spent lithium batteries is solvent extraction, with the core efficiency indicator being the cobalt extraction rate. Traditional methods optimize parameters such as extractant ratio, pH, and temperature through experimental trial and error, which suffers from high costs, long cycles, and difficulty in systematically quantifying the influence of these parameters.
[0003] Machine learning technology has been initially applied in the prediction of metal leaching rates and component identification in the recycling of waste batteries, but its research on cobalt extraction rate prediction is still lacking. Existing prediction models mostly rely on conventional loss functions (such as mean squared error) for hyperparameter optimization. Although they perform well on the training set, they are prone to overfitting, resulting in insufficient generalization ability and limiting the feasibility of practical industrial deployment.
[0004] However, existing machine learning-based prediction methods still have significant limitations in predicting the cobalt extraction rate of spent lithium-ion battery solutions. Since training data primarily comes from limited experimental or literature conditions, when the model focuses solely on prediction error as its optimization objective, it is prone to overfitting on the training or validation sets. This leads to a significant decrease in prediction accuracy under unknown leachate composition, extractant system, or reaction conditions. This problem directly limits the reliability of the model in optimizing actual cobalt recovery process parameters and designing processes.
[0005] Therefore, there is an urgent need for a method and system for predicting the cobalt extraction rate in waste lithium battery solutions that combines overfitting suppression mechanisms. This method and system can synergistically improve the model's generalization ability and prediction accuracy, providing technical support for the rapid optimization of cobalt extraction processes. Summary of the Invention
[0006] The objective of this invention is to provide a method and system for predicting the cobalt extraction rate in waste lithium battery solutions. By introducing a comprehensive evaluation mechanism that simultaneously reflects prediction error and overfitting during the model optimization process, the applicability and stability of the prediction model under unknown process conditions can be improved.
[0007] To achieve the above objectives, this invention provides a method for predicting the cobalt extraction rate in waste lithium battery solutions, comprising the following steps:
[0008] S1. Based on relevant literature data on cobalt recovery from leachate of waste lithium batteries, a cobalt extraction rate dataset was constructed, including raw material composition information, extractant composition information, and extraction reaction condition parameters. The dataset was then preprocessed to meet the requirements of machine learning modeling.
[0009] S2. Under default hyperparameter conditions, use multiple tree models to perform preliminary training and performance comparison on the dataset, and select the target prediction model type.
[0010] S3. Construct a comprehensive evaluation loss function for model optimization, which simultaneously reflects the model's prediction accuracy and the degree of model overfitting; preferably, the custom loss function constrains the prediction errors of the training set and the validation set simultaneously, so that the model avoids overfitting to a single dataset during the hyperparameter optimization process.
[0011] S4. Within the preset range of hyperparameter values, the comprehensive evaluation loss function is used as the optimization objective to optimize the hyperparameters of the target prediction model and obtain the cobalt extraction rate prediction model.
[0012] S5. Perform a generalization test on the cobalt extraction rate prediction model using unknown leachate parameters, and output the cobalt extraction rate prediction results under the corresponding conditions.
[0013] As a further improvement to the above scheme, the comprehensive evaluation loss function in step S3 includes:
[0014] Overfitting evaluation terms characterizing the degree of model overfitting;
[0015] Accuracy evaluation items characterizing the prediction accuracy of the model;
[0016] The overfitting evaluation term and the accuracy evaluation term are combined in a weighted manner to form a comprehensive evaluation index, which is used to guide the model hyperparameter optimization process.
[0017] As a further improvement to the above scheme, the overfitting evaluation term is composed of the difference between the prediction error of the training set and the prediction error of the validation set, and is used to quantify the degree of deviation of the model from the training data;
[0018] Specifically, the overfitting evaluation term is shown in the following formula:
[0019] ;
[0020] The closer this value is to zero, the lower the risk of overfitting;
[0021] The accuracy evaluation item is shown in the following formula:
[0022] ;
[0023] The closer this value is to zero, the better the model's predictive performance.
[0024] The specific formula for the comprehensive evaluation loss function is shown below:
[0025] ;
[0026] in, and These are the mean root mean square errors of the validation set and the training set, respectively. The mean of the coefficients of determination for the validation set. This represents the weighting percentage of the overfitted portion; The weighting percentage for the model's prediction accuracy.
[0027] As a further improvement to the above scheme, in step S1, the construction and preprocessing of the cobalt extraction rate dataset includes:
[0028] S11. Obtain cobalt extraction experimental data from waste lithium battery leachate through literature databases; preferably, search for titles and abstracts by keywords on Web of Science, CNKI, and Google Scholar, and then obtain the latest cobalt extraction experimental data by manually screening and organizing the classified and continuous data in the literature through Origin.
[0029] S12, The preprocessing includes:
[0030] Perform outlier removal and duplicate value merging on continuous variables;
[0031] The categorical variables are encoded and transformed, including solution type, solvent type, and extractant type.
[0032] And based on correlation analysis, feature variables used for modeling were selected.
[0033] As a further improvement to the above scheme, the correlation analysis includes Pearson correlation coefficient analysis and Spearman correlation coefficient analysis, which are used to evaluate the linear correlation and ordinal correlation between feature variables.
[0034] Specifically, the formula for calculating the Pearson correlation coefficient is as follows:
[0035] ;
[0036] Where n is the number of samples. and It is the value of the i-th data point. and It is the sample mean of variables x and y;
[0037] The formula for calculating the Spearman correlation coefficient is as follows:
[0038] ;
[0039] Where d i This represents the difference in rank between the i-th data pairs, where n is the number of samples.
[0040] As a further improvement to the above scheme, the preliminary model comparison in step S2 includes:
[0041] Lightweight Gradient Boosting Machine (LightGBM), Category Feature Gradient Boosting Machine (CatBoost), Extreme Gradient Boosting Machine (XGBoost), and Histogram Gradient Boosting Machine (HGBoost);
[0042] Cross-validation is performed under multiple random data partitioning conditions;
[0043] And the best-performing prediction model type is selected based on the error index.
[0044] As a further improvement to the above scheme, the hyperparameter optimization in step S4 includes joint optimization of tree depth, regularization parameter, sample subsampling ratio and feature sampling ratio.
[0045] As a further improvement to the above scheme, the hyperparameter optimization adopts an automated hyperparameter search strategy, and uses the comprehensive evaluation loss function as the sole optimization objective function.
[0046] As a further improvement to the above scheme, in step S5, when performing sample generalization testing on the cobalt extraction rate prediction model, the accuracy of the model is evaluated by inputting unknown leachate parameters.
[0047] Specifically, the test set data is input into the cobalt extraction rate prediction model for prediction, and the actual performance is evaluated. The evaluation indicators include mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²). 2 ;
[0048] The formula for calculating the mean absolute error is as follows:
[0049] ;
[0050] The formula for calculating the root mean square error is as follows:
[0051] ;
[0052] The formula for calculating the coefficient of determination is as follows:
[0053] ;
[0054] Where N is the sample size. It is the predicted output value. It is the actual output value. and Let be the true value and the predicted value of the i-th sample.
[0055] In a second aspect, the present invention also includes a cobalt extraction rate prediction system in waste lithium battery solution, comprising: a data construction and preprocessing module for constructing and processing a cobalt extraction rate dataset;
[0056] The model initial selection module is used to perform performance comparisons of multiple models under default hyperparameter conditions.
[0057] The loss function construction module is used to generate a comprehensive evaluation loss function that balances prediction accuracy and overfitting suppression.
[0058] The hyperparameter optimization module is used to optimize the model hyperparameters based on the comprehensive evaluation loss function; the prediction output module is used to output the prediction results of cobalt extraction rate in waste lithium battery solution.
[0059] As a further improvement to the above scheme, the modules are connected sequentially through data interfaces to realize the construction, optimization and application of the cobalt extraction rate prediction model.
[0060] Because the present invention adopts the above technical solutions, the beneficial effects of this application are as follows:
[0061] This invention provides a method for predicting the cobalt extraction rate in waste lithium battery solutions. By introducing an overfitting suppression mechanism into the construction and optimization process of the cobalt extraction rate prediction model, the stability and applicability of the model under different process conditions are improved while ensuring prediction accuracy. This method is suitable for process analysis and parameter prediction scenarios related to cobalt recycling from waste lithium batteries.
[0062] Specifically, the beneficial effects of the present invention are reflected in the following aspects:
[0063] To address the issues of variable extraction conditions and high experimental costs in the cobalt recycling process from waste lithium batteries, this invention constructs a cobalt extraction rate dataset that includes raw material composition, extractant composition, and reaction condition parameters. The data undergoes unified preprocessing, enabling the analysis of experimental data from different sources within the same modeling framework. This provides a stable data foundation for the quantitative prediction of cobalt extraction rates.
[0064] By conducting preliminary comparison and screening of various tree models under default hyperparameter conditions, the model type suitable for cobalt extraction rate prediction can be determined without introducing additional optimization bias. This avoids the uncertainty in model selection caused by directly entering a complex optimization process and improves the rationality of the subsequent model construction process.
[0065] This invention introduces a comprehensive evaluation loss function that simultaneously reflects prediction accuracy and overfitting during the model optimization process. By incorporating the prediction errors of both the training and validation sets into the optimization objective, the model no longer focuses solely on minimizing the error of a single dataset during the hyperparameter search process. This mechanism reduces the model's dependence on a specific sample distribution, thereby mitigating the risk of overfitting.
[0066] Hyperparameter optimization based on the comprehensive evaluation loss function enables the cobalt extraction rate prediction model to maintain relatively stable generalization performance while ensuring prediction accuracy. This facilitates the application of the model under unknown leachate composition or reaction conditions and enhances the applicability of the prediction results in the analysis of actual cobalt recovery processes.
[0067] By performing generalization tests on unknown leachate parameters and outputting corresponding cobalt extraction rate prediction results, this invention can provide a reference for evaluating the process conditions and screening parameters for cobalt extraction from waste lithium batteries without increasing experimental costs, thereby helping to reduce the number of experiments that rely on trial and error based on experience. Attached Figure Description
[0068] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. 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 the structures shown in these drawings without creative effort.
[0069] Figure 1 This is a flowchart illustrating a method for predicting the cobalt extraction rate in waste lithium battery solutions disclosed in this invention.
[0070] Figure 2 This is a schematic diagram of the correlation matrix between various feature variables in the dataset disclosed in this invention;
[0071] Figure 3 This paper presents a performance comparison of the four pre-selected tree models disclosed in this invention under default hyperparameters.
[0072] Figure 4 This is a schematic diagram illustrating the effect of the comprehensive evaluation loss function disclosed in this invention on the optimization process;
[0073] Figure 5 This is a schematic diagram of the Optuna hyperparameter optimization results disclosed in this invention;
[0074] Figure 6 This is a schematic diagram showing the fitting effect of the cobalt extraction rate prediction model disclosed in this invention.
[0075] The realization of the objective, functional characteristics and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0076] The technical solutions of the embodiments of the present invention will be clearly and completely described 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 are within the scope of protection of the present invention.
[0077] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0078] Example 1
[0079] See Figures 1-6 To address the challenges of complex experimental conditions, reliance on repeated trials for extraction rate, and insufficient stability of prediction models under unknown process conditions during cobalt recycling from spent lithium batteries, this invention provides a method for predicting the cobalt extraction rate in spent lithium battery solutions. This method incorporates a comprehensive evaluation mechanism that simultaneously reflects prediction error and overfitting during model optimization, ensuring relatively stable prediction performance under different leachate conditions. The method includes the following steps:
[0080] S1. Construction and preprocessing of cobalt extraction rate dataset:
[0081] A cobalt extraction rate dataset was constructed based on publicly available literature data related to cobalt recovery from leachate of spent lithium batteries. The dataset includes at least the following information:
[0082] The data includes information on raw material composition, extractant composition, and extraction reaction conditions, with cobalt extraction rate used as the target variable for prediction.
[0083] To enable data from different sources to be used for unified modeling, the dataset is preprocessed, including removing outlier data, normalizing numerical features of different dimensions, and encoding and converting categorical parameters.
[0084] Through the above processing, the dataset meets the input requirements for machine learning modeling, providing a stable data foundation for subsequent model training, thereby reducing the impact of data noise on prediction results.
[0085] S2. Preliminary screening of prediction models:
[0086] After data preprocessing, under default hyperparameter conditions, various tree models were selected to perform preliminary training and performance comparison on the dataset.
[0087] By comparing the prediction errors of different models on the same dataset, the target prediction model type suitable for predicting cobalt extraction rate is selected.
[0088] By completing the initial model selection under default hyperparameter conditions, we can avoid performing complex hyperparameter optimization directly before the model type is determined, thereby reducing the uncertainty in the model selection process and improving the rationality of subsequent optimization steps.
[0089] S3. Construction of the comprehensive evaluation loss function:
[0090] After determining the target prediction model type, a comprehensive evaluation loss function is constructed for model optimization.
[0091] The comprehensive evaluation loss function reflects both the model's prediction accuracy and its overfitting degree, wherein:
[0092] Prediction accuracy is used to characterize the model's ability to fit the cobalt extraction rate;
[0093] Overfit is used to characterize the difference in predictive performance between training and validation data.
[0094] Preferably, the comprehensive evaluation loss function constrains the prediction errors of both the training and validation sets simultaneously, thus preventing the model from fitting only a single dataset during the optimization process.
[0095] By introducing constraints on overfitting risk during the model optimization stage in the above manner, it is beneficial to improve the stability of the model under different data distribution conditions.
[0096] S4. Hyperparameter optimization based on the comprehensive evaluation loss function:
[0097] Within the preset range of hyperparameter values, the comprehensive evaluation loss function is used as the optimization objective to optimize the hyperparameters of the target prediction model, thereby obtaining the cobalt extraction rate prediction model.
[0098] By using the comprehensive evaluation loss function as the sole optimization objective, the model can simultaneously consider prediction accuracy and generalization ability during the hyperparameter search process. This reduces the overfitting problem caused by excessively pursuing the minimization of training error, making the obtained prediction model more suitable for prediction applications under unknown leachate process conditions.
[0099] S5. Generalization test and result output of the prediction model:
[0100] Using unknown leachate parameters that were not involved in model training as input, the cobalt extraction rate prediction model is generalized and tested, and the cobalt extraction rate prediction results under the corresponding conditions are output.
[0101] By predicting and verifying unknown process conditions, the applicability of the model in practical application scenarios can be evaluated, providing a reference for the analysis of process parameters and the screening of conditions for the recycling of cobalt from waste lithium batteries, thereby reducing the number of experiments that rely on trial and error based on experience to a certain extent.
[0102] In a preferred embodiment, the custom comprehensive evaluation loss function described in step S3 includes an overfitting evaluation term and an accuracy evaluation term, and the two are combined in a weighted manner to form a comprehensive evaluation index, which is used to guide the hyperparameter optimization process of the model.
[0103] Specifically, the overfitting evaluation term characterizes the degree of deviation of the model from the training data and the validation data. Specifically, the overfitting evaluation term consists of the difference between the prediction error on the training set and the prediction error on the validation set, and its calculation method is shown in the following formula:
[0104] ;
[0105] in, This represents the mean root mean square error of the model on the training set. This is the mean root mean square error of the model on the validation set.
[0106] In this way, when the prediction errors of the training set and the validation set are close, the value of the overfitting evaluation term approaches zero, indicating that the model's fit to the training data is consistent with its performance on the validation data, thus reflecting a low risk of model overfitting; conversely, when the value deviates from zero, it indicates that the model has a tendency to overfit the training data.
[0107] By introducing the overfitting evaluation term, the model optimization process can explicitly perceive the prediction differences between the training set and the validation set, thereby avoiding relying solely on training error for parameter adjustment.
[0108] The accuracy evaluation term is used to characterize the model's predictive ability for cobalt extraction rate, and its calculation method is shown in the following formula:
[0109] ;
[0110] in, This represents the mean of the model's coefficients of determination on the validation set.
[0111] By using the validation set determination coefficient as the basis for accuracy evaluation, the model's ability to fit data not used in training can be directly reflected, making the accuracy evaluation more closely reflect the model's performance in actual prediction scenarios.
[0112] In this embodiment, a custom comprehensive evaluation loss function is formed by weighting and combining the above-mentioned overfitting evaluation term and accuracy evaluation term, the specific form of which is shown in the following formula:
[0113] ;
[0114] in, The weighting coefficients for the overfitting evaluation term are in the candidate range of 0-1, and are used to adjust the degree of constraint on the risk of overfitting in the model. The weighting coefficient for the accuracy evaluation term has a candidate range of 0-1 and is used to adjust the model's focus on prediction accuracy.
[0115] By using the above comprehensive evaluation indicators, a balance can be struck between prediction accuracy and overfitting suppression during model hyperparameter optimization. This ensures that the optimization process no longer simply pursues error minimization, but also considers the model's consistent performance across different datasets. See also Figure 4 As can be seen, the metrics for preventing overfitting are better at tracking the overfitting trend of the model than the default loss function. Specifically, the horizontal axis (Trial / Number of Iterations) represents the number of iterations or trials in the hyperparameter optimization. The figure shows the process of approximately 35 iterations, used to observe the dynamic changes of various metrics as optimization progresses.
[0116] The vertical axis (indicator value) shows numerical feedback across two dimensions:
[0117] The left main axis (error / loss value): corresponds to the blue line (custom loss function) and the orange line (default loss function). The value represents the model's overall loss score under the current parameters; the lower the value, the better the model's overall performance in terms of accuracy and stability.
[0118] The right-hand secondary axis (degree of overfitting): corresponds to the gray curve (actual overfitting changes). The numerical values represent the overfitting index (from...). (Calculated) The closer this value is to 0, the lower the risk of overfitting the model.
[0119] The comparison in this figure shows that, compared to the "default loss function" (orange line), which exhibits less fluctuation and fails to reflect generalization risk, the custom loss function (blue line) more sensitively tracks and guides the model to reduce the "actual overfit index" (gray line). This demonstrates that this method, while improving model accuracy, can more effectively suppress overfitting.
[0120] By using the aforementioned custom comprehensive evaluation loss function as the model optimization objective, the prediction model is simultaneously constrained by prediction accuracy and overfitting during the optimization stage. This helps to reduce the model's dependence on specific training sample distributions, thereby improving the model's applicability and stability under unknown leachate composition and reaction conditions. It is suitable for predicting and analyzing the cobalt extraction rate of waste lithium batteries.
[0121] As a preferred embodiment, in order to further address the problem of scattered sources and inconsistent parameter formats in the cobalt extraction experiment data of waste lithium batteries, which in turn affect the stability and applicability of the prediction model, this embodiment further explains the construction and preprocessing process of the cobalt extraction rate dataset in step S1.
[0122] S11. Acquisition of cobalt extraction experimental data:
[0123] In this embodiment, experimental data on cobalt extraction from leachate of spent lithium-ion batteries are obtained through literature databases. Specifically, literature databases such as Web of Science, CNKI, and Google Scholar are searched using keywords related to cobalt recycling from spent lithium-ion batteries, targeting both the titles and abstracts of relevant documents. Specifically, the search keywords can be selected as "spentlithium ion battery," "cobalt recovery," and "extraction."
[0124] After obtaining the search results, literature irrelevant to cobalt extraction or with incomplete experimental conditions was manually screened out. The experimental data from the remaining literature were then organized, and continuous and categorical parameters were extracted to form the original cobalt extraction experimental dataset. In this original cobalt extraction experimental dataset, the continuous independent variable x includes initial cobalt concentration, extractant concentration, O / A ratio, initial pH, equilibrium pH, temperature, and time; the categorical independent variable x includes the type of anion in the solution, the type of extractant, the type of co-extractant, and the type of organic solvent; and the predictive variable y is the cobalt extraction rate.
[0125] The above method allows for the collection of cobalt extraction experimental data from multiple sources without increasing experimental costs, providing a representative sample base for subsequent modeling.
[0126] S12. Dataset preprocessing:
[0127] To make the cobalt extraction experimental data suitable for machine learning modeling, the original dataset is preprocessed, including the following:
[0128] First, outlier removal and duplicate value merging are performed on continuous variables. For example, outliers with the same x variable but different y variables are removed, and the interquartile range (interquartile range) is used to remove data outside the lower and upper limits. By removing data points that significantly deviate from the normal range, the interference of abnormal experimental results on model training is reduced, thereby improving the overall consistency of the dataset.
[0129] Secondly, the categorical variables are encoded and transformed. These categorical variables include solution type, solvent type, and extractant type. The solution type, extractant type, and co-extractant type are encoded using unique thermal encoding, while organic solvents are encoded by the percentage of cycloalkanes, alkanes, and aromatics. By converting these categorical variables into numerical forms that the model can recognize, different categories of information can participate in model training, which is beneficial for the model to learn the characteristics of different extraction systems.
[0130] Secondly, feature variables are screened using correlation analysis. By analyzing the correlation between each feature variable and the cobalt extraction rate, feature variables that actually contribute to the prediction results are selected, reducing redundant or low-correlation parameters from entering the model, thereby reducing model complexity.
[0131] The above preprocessing steps ensure that the constructed dataset maintains the integrity of process information while reducing the adverse effects of noise and redundant features on model training, which helps improve the stability of the prediction model under different data partitions and unknown process conditions.
[0132] To further address the issue that the large number of feature variables and complex correlations in the prediction of cobalt extraction rate from waste lithium batteries can easily introduce redundant features and affect model stability, this embodiment further explains the correlation analysis method in step S12.
[0133] In this embodiment, the correlation analysis includes Pearson correlation coefficient analysis and Spearman correlation coefficient analysis, which are used to evaluate the linear correlation and ordinal correlation between feature variables, respectively, thereby providing a basis for feature selection. Figure 2 The heatmap features show the correlation matrix between the various feature variables in the dataset. The vertical and horizontal axes list the exact same variable names, covering key physicochemical parameters affecting cobalt extraction rates.
[0134] Acidic media and concentrations: such as H2SO4 (sulfuric acid), HCl (hydrochloric acid), HNO3 (nitric acid), etc.
[0135] Raw material information: such as Cobalt(II) g / L (initial cobalt concentration), Nickel(II) g / L (nickel ion concentration), etc.
[0136] Information on extractants and solvents: such as Acidic Extractant, Extractant Concentration, Alkanes (%), etc.
[0137] Reaction conditions include: Temperature (K), Contact time (min), A / O ratio, Initial pH, and Equilibrium pH.
[0138] The chart reflects the core information of the correlation coefficient: each square in the chart represents the correlation coefficient between two variables (such as the Pearson correlation coefficient or the Spearman correlation coefficient).
[0139] Color intensity: Color usually represents the strength of the correlation. Dark red usually represents a strong positive correlation, and dark blue represents a strong negative correlation.
[0140] This graph is used to check for severe linear correlations (collinearity) between features to ensure that the features input to the model are independent. For example... Figure 2 As shown, the maximum Pearson correlation coefficient between features is 0.82, which provides a basis for data preprocessing in subsequent machine learning modeling.
[0141] The Pearson correlation coefficient is used to measure the degree of linear correlation between two continuous characteristic variables. Its calculation formula is shown in the following equation:
[0142] ;
[0143] Where n is the number of samples. and Let be the values of the two feature variables in the i-th sample, respectively. and These are the sample means of the corresponding feature variables.
[0144] By calculating the Pearson correlation coefficient between different feature variables, feature pairs with a high linear correlation can be identified, thereby filtering or merging redundant features in the subsequent modeling process and reducing the linear dependence between model input variables.
[0145] To further evaluate whether there is a non-linear but consistent correlation among the feature variables, this implementation introduces Spearman correlation coefficient analysis. The Spearman correlation coefficient measures the consistency between the ranking results of two variables, and its calculation formula is shown below:
[0146] ;
[0147] in, This represents the difference between the rank values of the two variables in the i-th sample, where n is the number of samples.
[0148] Spearman correlation coefficient analysis can identify characteristic variables that, although they do not satisfy a linear relationship, have a strong consistency in their numerical trends, thus avoiding the neglect of potential important characteristic relationships by relying solely on linear analysis methods.
[0149] By combining Pearson correlation coefficient analysis and Spearman correlation coefficient analysis, the linear correlation and ordinal correlation between feature variables can be comprehensively evaluated. This can effectively identify redundant or low-correlation feature variables during the data preprocessing stage and reduce irrelevant features from entering the model training process.
[0150] The aforementioned correlation analysis method helps to reduce the redundancy between model input features and alleviate model complexity, thereby reducing the risk of model overfitting to a certain extent and enabling the subsequently constructed cobalt extraction rate prediction model to maintain relatively stable prediction performance under different data partitioning and unknown leachate process conditions.
[0151] As a preferred embodiment, the specific implementation process of the preliminary model comparison and screening in step S2 is as follows:
[0152] Pre-selected model library construction: In the implementation, four high-performance gradient boosting tree machine learning model classes were pre-selected, specifically including: Lightweight Gradient Boosting Machine (LightGBM), Category Feature Gradient Boosting Machine (CatBoost), Extreme Gradient Boosting (XGBoost), and Histogram Gradient Boosting (HGBoost). Each model class was first evaluated using default hyperparameters.
[0153] Multiple random partitioning validation: To eliminate the random bias caused by a single data partition, multiple random seeds (e.g., 0 to 100) are used to repeatedly partition the dataset randomly. A 5-fold cross-validation mode is employed under each partition condition.
[0154] Multidimensional evaluation metric selection: Mean absolute error, root mean square error, and coefficient of determination are used as core evaluation metrics. By comparing the average performance of different models on the validation set, the model type with the best predictive performance is selected.
[0155] By cross-validating and comparing various mainstream algorithms on multiple sets of random samples, we can objectively evaluate the fit of each algorithm to the cobalt extraction dataset, thereby selecting the model with the strongest basic generalization potential. Specifically, in Figure 3In the graph, the horizontal axis (Model Type) represents the four pre-selected machine learning algorithm classes, from left to right: CatBoost, Histogram Boosting, Lightweight Boosting (LGBoost), and Extreme Gradient Boosting (XGBoost). The vertical axis (Val_RMSE) represents the root mean square error of the validation set obtained by performing 5-fold cross-validation on datasets with different random seed partitions. A comparison clearly shows that the XGBoost model has the lowest overall box position, with an average RMSE of 14.49, thus it is determined as the preferred model class for subsequent deep optimization.
[0156] In a preferred embodiment, the hyperparameter optimization in step S4 includes joint optimization of tree depth, regularization parameter, sample subsampling ratio, and feature sampling ratio.
[0157] Tree depth controls the structural complexity of a single decision tree. By optimizing tree depth, a balance can be struck between the model's expressive power and structural complexity.
[0158] When the tree depth is large, the model can fit more complex data relationships, but at the same time it is prone to overfitting the training data. Optimizing the tree depth within a preset range helps to limit the model complexity, so that the model can reduce its dependence on local sample features while maintaining the necessary fitting ability.
[0159] Regularization parameters are used to constrain the range of values for model parameters. By optimizing the regularization parameters, instability caused by excessively large model parameters can be suppressed.
[0160] In this embodiment, by incorporating regularization parameters into the joint optimization process, the model's sensitivity to noise features during training is reduced, thereby reducing prediction bias caused by individual abnormal samples and improving the model's stability under different data distribution conditions.
[0161] The sample subsampling ratio controls the proportion of samples used in model construction during training. By optimizing the sample subsampling ratio, the model learns based on different sample subsets in each training round, thereby reducing the model's dependence on a fixed combination of training samples.
[0162] The above methods help enhance the model's adaptability to data changes, reduce the risk of overfitting, and enable the model to maintain relatively consistent predictive performance under unknown leachate process conditions.
[0163] The feature sampling ratio controls the number of features involved in splitting or modeling during training. Optimizing the feature sampling ratio can reduce mutual interference between features and mitigate the impact of redundant features on model training.
[0164] By adjusting the feature sampling ratio during the joint optimization process, it is beneficial to highlight the feature information that actually contributes to the prediction of cobalt extraction rate, thereby improving the stability of the prediction results without increasing the model complexity.
[0165] By jointly optimizing the tree depth, regularization parameters, sample subsampling ratio, and feature sampling ratio, the prediction model forms a collaborative constraint mechanism in terms of structural complexity control, parameter constraints, and sample and feature utilization methods.
[0166] The aforementioned joint optimization approach helps to achieve a balance between prediction accuracy and generalization ability, reduces the model's dependence on specific training samples or feature combinations, and thus improves the applicability and stability of the cobalt extraction rate prediction model under different leachate compositions and reaction conditions.
[0167] As a preferred embodiment, in order to further address the problems of the cobalt extraction rate prediction model relying on human experience, having low parameter tuning efficiency, and being prone to bias towards a single precision index during the hyperparameter setting process, in this embodiment, the hyperparameter optimization (Optuna automatic optimization) adopts an automated hyperparameter search strategy, and uses the custom comprehensive evaluation loss function as the sole optimization objective function.
[0168] The automated hyperparameter search strategy is used to automatically generate hyperparameter combinations within a preset hyperparameter value space according to predetermined search rules, and to train and evaluate the model corresponding to each set of hyperparameters. By adopting an automated search method, the subjectivity caused by manually setting parameter combinations can be reduced, and the hyperparameter optimization process can be completed automatically under a unified evaluation standard, thereby improving the repeatability and stability of the optimization process.
[0169] Specifically, in step S4, Optuna is used to automatically optimize the hyperparameters of the XGBoost model. This aims to further enhance the model's prediction accuracy and strictly control the risk of overfitting through fine-tuning. The specific implementation process is as follows:
[0170] Optimize environment configuration: Select the data partition corresponding to the random seed (e.g., random seed 35) that best matches the average performance index in the initial comparison as the optimization benchmark.
[0171] Hyperparameter search space settings: Define the search range for the core parameters that affect generalization performance in the XGBoost model:
[0172] Regularization terms: Set the values for L1 regularization and L2 regularization to be between 0 and 50.
[0173] Tree structure parameters: Set the maximum depth of the tree to 2 to 10 levels.
[0174] Sampling and Feature Ratios: The range of values for sample subsampling ratio, feature ratio per layer, feature ratio per split point, and feature ratio per tree are all uniformly set to 0.1 to 1.
[0175] Custom Loss Function Guidance: In Optuna's iterative optimization process, instead of using a traditional single error function, a custom Comprehensive Evaluation Index (CEI) constructed in step S3 is introduced as the objective function. This index is determined through weight allocation (e.g., ... =0.008, =1), in pursuit of high While improving prediction accuracy, a penalty is imposed on the error offset between the training set and the validation set.
[0176] For details, see Figure 5 The graph illustrates the iterative process and results of Optuna hyperparameter optimization. The horizontal axis (Trial / Number of Trials) represents the number of iterations performed by the Optuna automatic optimization algorithm. As shown in the graph, the system conducted approximately 500 trials, each representing a different set of hyperparameter combinations. The vertical axis (Objective Value / Objective Function Value) represents the model's score under the custom loss function (Comprehensive Evaluation Index, CEI) in each trial. This value is calculated by weighting the model accuracy and overfitting indices. A lower value indicates a more ideal overall performance of the model under that set of hyperparameters, achieving both high accuracy and low overfitting. The red line in the graph connects the "current optimal value" during the optimization process, showing that as the number of trials increases, the objective value generally decreases and then stabilizes; the scatter plot distribution gradually concentrates from initial high-level oscillations to a low-level range, indicating that the Optuna algorithm successfully located a globally optimal solution within the pre-defined hyperparameter search space.
[0177] The optimal hyperparameters determined through this optimization process are: L1 regularization of 28.83, L2 regularization of 15.11, tree depth of 6, sample subsampling ratio of 0.52, feature ratio per layer of 0.92, feature ratio per split point of 0.60, and feature ratio per lesson of 0.89, with α of 0.008 and β of 1. Applying the training set data to the above hyperparameter combination yields the final cobalt extraction rate prediction model, which significantly reduces the overfitting index and improves the generalization performance.
[0178] During the automated hyperparameter search process, model performance is evaluated solely based on the custom comprehensive evaluation loss function. This function includes both an evaluation term reflecting prediction accuracy and an evaluation term reflecting overfitting, ensuring that each hyperparameter combination is subject to both accuracy and overfitting constraints during evaluation. By setting the custom comprehensive evaluation loss function as the sole objective function, conflicts between different evaluation metrics during optimization are avoided. This ensures that the hyperparameter search process always revolves around improving the model's stability under unknown data conditions, rather than simply minimizing training or validation errors.
[0179] An automated hyperparameter search strategy is adopted, with the custom comprehensive evaluation loss function as the sole optimization objective, enabling the model to form a unified and clear optimization direction during the hyperparameter optimization stage. On the one hand, this improves the efficiency of the hyperparameter search process and reduces the time cost of repeated manual trials; on the other hand, by comprehensively considering prediction accuracy and overfitting risk, the final cobalt extraction rate prediction model exhibits relatively consistent prediction performance under different leachate compositions and reaction conditions.
[0180] As a preferred embodiment, to further verify the applicability of the cobalt extraction rate prediction model optimized through the comprehensive evaluation mechanism under unknown process conditions, a sample generalization test was conducted on the model.
[0181] In this embodiment, test set data that did not participate in the model training and hyperparameter optimization process is used as input, and the test set contains unknown combinations of leachate parameters.
[0182] By inputting test set data into the cobalt extraction rate prediction model, the predicted cobalt extraction rate under corresponding conditions is obtained, thereby evaluating the model's predictive performance under different data distribution conditions. This method allows for an objective evaluation of the prediction model's generalization ability without relying on training data, which is beneficial in determining whether the model is effective only for training samples but fails under unknown process conditions.
[0183] To comprehensively evaluate the performance of the prediction model, this implementation method uses mean absolute error, root mean square error, and coefficient of determination as evaluation indicators.
[0184] Mean absolute error (MAE) measures the average deviation between predicted and actual values, and its calculation formula is shown below:
[0185] ;
[0186] in, For the sample size, For the first The true cobalt extraction rate of each sample This is the corresponding predicted value.
[0187] The root mean square error (RMSE) is used to measure the overall fluctuation of prediction error, and its calculation formula is shown below:
[0188] ;
[0189] The root mean square error (RMSE) can reflect the model's sensitivity to large prediction biases and help assess the model's stability under different sample conditions.
[0190] The coefficient of determination is used to characterize the degree to which the model fits the overall trend of the test data. Its calculation formula is shown below:
[0191] ;
[0192] in, The average cobalt extraction rate was used to test the concentration.
[0193] By using the above three types of evaluation indicators simultaneously, the model performance can be evaluated from multiple perspectives, such as the magnitude of the prediction error, the error distribution, and the overall fit, thus avoiding evaluation bias caused by relying on only a single indicator.
[0194] By conducting sample generalization tests on the cobalt extraction rate prediction model and combining it with multi-index evaluation methods, the model's prediction accuracy and stability under unknown leachate composition and reaction conditions can be verified. This testing process helps to confirm the actual effectiveness of the aforementioned comprehensive evaluation loss function and automated hyperparameter optimization strategy in suppressing overfitting, thereby making the prediction model more suitable for process analysis and parameter evaluation related to cobalt recycling from waste lithium batteries.
[0195] Figure 6 The diagram demonstrates the fitting performance of the final optimized XGBoost model on the training and test sets. Its horizontal axis (Actual Extraction Efficiency (%) / Actual Extraction Rate) represents the experimentally measured actual extraction rate of cobalt ions in the waste lithium battery solution.
[0196] The vertical axis (Predicted Extraction Efficiency (%)) represents the predicted extraction rate calculated by the optimized machine learning model based on the input parameters.
[0197] The chart reflects the core information of the data point distribution: the chart contains scatter points of two colors, green points represent the prediction results of the training set, and blue points represent the prediction results of the test set.
[0198] Diagonal reference line: The dashed line in the figure is the y=x reference line. The closer the scatter points are to this dashed line, the closer the predicted values are to the true values, and the higher the model accuracy.
[0199] Generalization performance verification: As shown in the graph, the distribution trends of the test set (blue dots) and the training set (green dots) are highly consistent, both closely surrounding the reference line. This proves that after optimization with a custom loss function, the model not only possesses high prediction accuracy, but also... 2 The coefficient of performance reached 0.84, the RMSE was 14.75, and the MAE was 10.44. The overfitting index was 0.63. Compared with the default hyperparameters, the overfitting phenomenon of the final cobalt extraction rate prediction model was reduced by 82%, showing excellent generalization performance and prediction accuracy, and effectively solving the overfitting problem.
[0200] Example 2
[0201] Based on the method embodiment of Example 1, the present invention also provides a cobalt extraction rate prediction system in waste lithium battery solution, which is used to implement the cobalt extraction rate prediction method disclosed in Example 1 in a systematic manner, so as to solve the problems of low efficiency of manual analysis, scattered model construction process and difficulty in ensuring the stability of prediction results.
[0202] The cobalt extraction rate prediction system for waste lithium battery solutions includes:
[0203] The module includes data construction and preprocessing, model initial selection, loss function construction, hyperparameter optimization, and prediction output.
[0204] The modules are connected sequentially through data interfaces to form a complete data processing and model prediction process, so as to realize the construction, optimization and application of the cobalt extraction rate prediction model.
[0205] The data construction and preprocessing module is used to construct and process the cobalt extraction rate dataset.
[0206] This module is used to receive cobalt extraction experimental data from waste lithium battery leachate from literature databases or historical experimental records, and to organize and preprocess the data, including outlier handling, duplicate value merging, categorical variable encoding, and feature filtering.
[0207] By unifying experimental data from multiple sources into a standardized dataset, the subsequent model training process can be based on consistent data input conditions, which helps to reduce the impact of data noise on the stability of the prediction model.
[0208] The model initial selection module is used to perform performance comparisons of multiple models under default hyperparameter conditions.
[0209] This module trains multiple candidate prediction models and compares their prediction errors under the same dataset conditions to select the target model type suitable for cobalt extraction rate prediction. By introducing a model selection module into the system, a reasonable model type can be selected without introducing complex optimization, avoiding the impact of inappropriate model selection on subsequent optimization results.
[0210] The loss function construction module is used to generate a comprehensive evaluation loss function that takes into account both prediction accuracy and overfitting suppression.
[0211] This module constructs an evaluation index based on the prediction results of training and validation data, which simultaneously reflects the model's prediction error and overfitting degree, and is used to uniformly evaluate the performance of different combinations of model parameters. By introducing a comprehensive evaluation loss function at the system level, the model optimization process no longer relies solely on a single accuracy index, thus providing a constrained basis for the stable application of the model under unknown leachate conditions.
[0212] The hyperparameter optimization module is used to optimize the model hyperparameters based on the comprehensive evaluation loss function.
[0213] This module generates hyperparameter combinations using an automated search method within a preset range of hyperparameter values, and adjusts the parameters of the target prediction model using a comprehensive evaluation loss function as the sole optimization objective. By systematizing the hyperparameter optimization process and combining it with a comprehensive evaluation mechanism, it helps to achieve a balance between prediction accuracy and generalization ability, and reduces the model's dependence on specific training samples or feature combinations.
[0214] The prediction output module is used to output the prediction result of cobalt extraction rate in waste lithium battery solution.
[0215] This module receives an optimized cobalt extraction rate prediction model and takes unknown leachate parameters as input, outputting predicted cobalt extraction rates under the corresponding conditions. Through this systematic prediction output module, rapid prediction of cobalt extraction rates under different process conditions can be achieved without repeatedly building and tuning the model, providing a reference for cobalt recovery process analysis and parameter evaluation.
[0216] By connecting the above modules in the order of data interfaces, a complete system process is formed from data construction, model selection, optimization to prediction output, which makes the cobalt extraction rate prediction process have good repeatability and consistency.
[0217] This system structure facilitates the stable application of the aforementioned prediction method to the analysis of cobalt extraction rate under different leaching conditions of spent lithium batteries, thereby improving the applicability of the prediction results in practical process applications.
[0218] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. All equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A method for predicting the cobalt extraction rate in waste lithium battery solutions, characterized in that, The steps include: S1. Based on relevant literature data on cobalt recovery from leachate of waste lithium batteries, a cobalt extraction rate dataset was constructed, including raw material composition information, extractant composition information, and extraction reaction condition parameters. The dataset was then preprocessed to meet the requirements of machine learning modeling. S2. Under default hyperparameter conditions, use multiple tree models to perform preliminary training and performance comparison on the dataset, and select the target prediction model type. S3. Construct a comprehensive evaluation loss function for model optimization, which simultaneously reflects the model's prediction accuracy and the degree of model overfitting; S4. Within the preset range of hyperparameter values, the comprehensive evaluation loss function is used as the optimization objective to optimize the hyperparameters of the target prediction model and obtain the cobalt extraction rate prediction model. S5. Perform a generalization test on the cobalt extraction rate prediction model using unknown leachate parameters, and output the cobalt extraction rate prediction results under the corresponding conditions.
2. The method for predicting the cobalt extraction rate in waste lithium battery solution according to claim 1, characterized in that, The comprehensive evaluation loss function in step S3 includes: Overfitting evaluation terms characterizing the degree of model overfitting; Accuracy evaluation items characterizing the prediction accuracy of the model; The overfitting evaluation term and the accuracy evaluation term are combined in a weighted manner to form a comprehensive evaluation index, which is used to guide the model hyperparameter optimization process.
3. The method for predicting the cobalt extraction rate in waste lithium battery solution according to claim 2, characterized in that, The specific formula for the comprehensive evaluation loss function is shown below: ; The overfitting evaluation term The closer the value is to zero, the lower the risk of overfitting; the accuracy evaluation term The closer the value is to zero, the better the model's predictive performance; in, and These are the mean root mean square errors of the validation set and the training set, respectively. The mean of the coefficients of determination for the validation set. This represents the weighting percentage of the overfitted portion; The weighting percentage for the model's prediction accuracy.
4. A method for predicting the cobalt extraction rate in waste lithium battery solution according to any one of claims 1-3, characterized in that, In step S1, the construction and preprocessing of the cobalt extraction rate dataset includes: S11. Obtain experimental data on cobalt extraction from leachate of waste lithium batteries through literature databases; S12, The preprocessing includes: Perform outlier removal and duplicate value merging on continuous variables; The categorical variables are encoded and transformed, including solution type, solvent type, and extractant type. And based on correlation analysis, feature variables used for modeling were selected.
5. The method for predicting the cobalt extraction rate in waste lithium battery solution according to claim 4, characterized in that, The correlation analysis includes Pearson correlation coefficient analysis and Spearman correlation coefficient analysis, which are used to assess the linear correlation and ordinal correlation between feature variables.
6. A method for predicting the cobalt extraction rate in waste lithium battery solution according to any one of claims 1-3, characterized in that, The preliminary model comparison in step S2 includes: Lightweight gradient booster, category feature gradient booster, extreme gradient booster, and histogram gradient booster; Cross-validation is performed under multiple random data partitioning conditions; And the best-performing prediction model type is selected based on the error index.
7. A method for predicting the cobalt extraction rate in waste lithium battery solution according to any one of claims 1-3, characterized in that, The hyperparameter optimization in step S4 includes joint optimization of tree depth, regularization parameter, sample subsampling ratio, and feature sampling ratio.
8. The method for predicting the cobalt extraction rate in waste lithium battery solution according to claim 7, characterized in that, The hyperparameter optimization employs an automated hyperparameter search strategy, and uses the comprehensive evaluation loss function as the sole optimization objective function.
9. A method for predicting the cobalt extraction rate in waste lithium battery solution according to any one of claims 1-3, characterized in that, In step S5, during the generalization test, the data from the test set is input into the cobalt extraction rate prediction model for prediction, and the actual performance is evaluated. The evaluation indicators include mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²). 2 .
10. A system for predicting the cobalt extraction rate in waste lithium battery solutions, characterized in that, include: The data construction and preprocessing module is used to construct and process the cobalt extraction rate dataset; The model initial selection module is used to perform performance comparisons of multiple models under default hyperparameter conditions. The loss function construction module is used to generate a comprehensive evaluation loss function that balances prediction accuracy and overfitting suppression. The hyperparameter optimization module is used to optimize the model hyperparameters based on the comprehensive evaluation loss function. The prediction output module is used to output the prediction results of cobalt extraction rate in waste lithium battery solution.