In the rapidly evolving landscape of electric vehicles and energy storage systems, the demand for high-performance lithium-ion batteries has surged dramatically. As a result, battery manufacturers face immense pressure to enhance production capacity while maintaining stringent quality controls. The traditional manufacturing process for li-ion batteries involves multiple intricate steps, including electrode preparation, cell assembly, formation, and capacity grading (often called “formation and aging” or “sorting”). Among these, the capacity grading step is critical for ensuring cell-to-cell consistency, which directly impacts the reliability and longevity of battery packs. However, this process typically requires time-consuming charge-discharge cycles on specialized equipment, leading to increased costs and production bottlenecks. In this study, we explore a novel data-driven approach to predict the capacity of li-ion batteries directly from production line monitoring data, aiming to simplify or even eliminate the conventional grading step. By leveraging machine learning algorithms, we establish a predictive model that correlates pre-grading process parameters with post-grading capacity, offering a pathway to streamline manufacturing and improve efficiency.

The production of li-ion batteries is a complex, multi-stage endeavor where each step influences the final cell performance. Key stages include mixing electrode slurries, coating and drying electrodes, calendaring, slitting, stacking or winding, assembly, electrolyte filling, formation, and final testing. During formation, a small current is applied to activate the cell, forming the solid-electrolyte interphase (SEI) layer, which is crucial for stability. Subsequently, capacity grading involves full charge-discharge cycles to measure the actual capacity and internal resistance, categorizing cells into performance bins. This step ensures that only cells with similar characteristics are grouped together, minimizing imbalances in battery packs. However, it is resource-intensive, often accounting for a significant portion of production time and energy consumption. Therefore, developing alternative methods to predict capacity without extensive cycling is highly desirable. Recent advances in data science and machine learning provide a promising avenue. By analyzing historical production data, we can uncover hidden patterns and nonlinear relationships between process variables and cell outcomes. In this work, we utilize over 20,000 data points from a real li-ion battery production line to train and validate multiple machine learning models for capacity prediction.
Our dataset comprises 20,997 records, each representing a single li-ion battery cell with a standard capacity of 108 Ah. For each cell, we collected 20 feature parameters from various production stages, along with the measured capacity from grading. The features include physical attributes like jelly roll weights (A roll weight, B roll weight, total jelly roll weight), electrolyte injection data (first and second injection amounts, masses before and after injection), formation process parameters (three temperature measurements and three cutoff voltage measurements during formation), open-circuit voltage (OCV) test results (resistance and voltage at two OCV checkpoints), and direct current internal resistance (DCIR). These parameters were selected based on domain knowledge of li-ion battery manufacturing, as they capture critical aspects of electrode loading, electrolyte saturation, formation quality, and internal resistance, all of which influence final capacity. The target variable is the graded capacity in ampere-hours (Ah). To prepare for modeling, we performed data cleaning and normalization, ensuring consistency across all records.
Before applying machine learning, we conducted a preliminary analysis using Pearson correlation coefficients to assess linear relationships between each feature and the capacity. The Pearson correlation coefficient between two variables X and Y is defined as:
$$ \rho_{X,Y} = \frac{\text{cov}(X,Y)}{\sigma_X \sigma_Y} $$
where cov denotes covariance and σ represents standard deviation. However, as shown in Table 1, the absolute correlation values were generally low (below 0.6), indicating weak linear associations. For instance, features like formation temperatures and OCV voltages had coefficients below 0.3, suggesting that their relationships with capacity might be nonlinear. This underscores the limitation of linear methods and motivates the use of nonlinear machine learning algorithms.
| Feature Parameter | Pearson Correlation with Capacity |
|---|---|
| A Jelly Roll Weight | 0.45 |
| B Jelly Roll Weight | 0.47 |
| Total Jelly Roll Weight | 0.52 |
| First Electrolyte Injection Amount | 0.12 |
| Mass Before First Injection | 0.18 |
| Mass After First Injection | 0.21 |
| Formation Temperature 1 | 0.08 |
| Formation Temperature 2 | 0.11 |
| Formation Temperature 3 | 0.09 |
| Formation Cutoff Voltage 1 | -0.15 |
| Formation Cutoff Voltage 2 | -0.18 |
| Formation Cutoff Voltage 3 | -0.22 |
| Second Electrolyte Injection Amount | 0.10 |
| Mass Before Second Injection | 0.17 |
| Mass After Second Injection | 0.20 |
| OCV1 Resistance | -0.05 |
| OCV1 Voltage | 0.14 |
| OCV2 Resistance | -0.07 |
| OCV2 Voltage | 0.25 |
| DCIR | -0.28 |
We employed four nonlinear machine learning regression algorithms: Random Forest (RF), Gradient Boosting Machine (GBM), XGBoost, and CatBoost. These algorithms are ensemble methods that combine multiple decision trees to capture complex patterns. RF builds independent trees and averages their predictions, while GBM, XGBoost, and CatBoost are boosting techniques that sequentially correct errors. CatBoost, in particular, is designed to handle categorical features efficiently, though in our case, all features are numerical. For each algorithm, we performed hyperparameter tuning using grid search and cross-validation to optimize performance. The dataset was split into training and testing sets with a 3:1 ratio via stratified sampling, ensuring representative distributions. The training set contained 15,800 samples, and the test set had 5,197 samples from the li-ion battery production line.
Model performance was evaluated using two metrics: Root Mean Square Error (RMSE) and Coefficient of Determination (R²). RMSE measures the average prediction error in the same units as capacity (Ah), while R² indicates the proportion of variance explained by the model. Their formulas are:
$$ \text{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i^{\text{test}} – \hat{y}_i^{\text{test}})^2} $$
$$ R^2 = 1 – \frac{\sum_{i=1}^{n} (y_i^{\text{test}} – \hat{y}_i^{\text{test}})^2}{\sum_{i=1}^{n} (y_i^{\text{test}} – \bar{y}^{\text{test}})^2} $$
where \( y_i^{\text{test}} \) is the actual capacity, \( \hat{y}_i^{\text{test}} \) is the predicted capacity, \( \bar{y}^{\text{test}} \) is the mean actual capacity, and n is the number of test samples. Lower RMSE and higher R² signify better predictions. We also conducted five-fold cross-validation on the training set to assess model stability.
The results of our modeling are summarized in Table 2. All four algorithms achieved promising performance, with test set RMSE values below 0.35% of the standard capacity (108 Ah, i.e., 378 mAh). The CatBoost model yielded the best results, with an RMSE of 348.81 mAh (0.32% of 108 Ah) and an R² of 0.6206. The RF model closely followed with an RMSE of 349.71 mAh and R² of 0.6186. GBM and XGBoost performed slightly worse but still within acceptable margins. The cross-validation averages confirmed the robustness of these models. For comparison, we also trained models using only features with absolute Pearson correlation greater than 0.2 (8 features), but as shown in Table 2, this feature screening led to degraded performance, highlighting the importance of including all parameters for capturing nonlinear relationships in li-ion battery data.
| Machine Learning Algorithm | 5-Fold CV Average RMSE (mAh) | Test Set RMSE (mAh) | Test Set R² | Test Set RMSE After Feature Screening (mAh) | Test Set R² After Feature Screening |
|---|---|---|---|---|---|
| Random Forest (RF) | 361.29 | 349.71 | 0.6186 | 437.09 | 0.4042 |
| Gradient Boosting Machine (GBM) | 394.32 | 371.32 | 0.5700 | 448.59 | 0.3724 |
| XGBoost | 413.91 | 366.53 | 0.5810 | 453.68 | 0.3581 |
| CatBoost | 357.48 | 348.81 | 0.6206 | 433.43 | 0.4142 |
To delve deeper, we analyzed the prediction accuracy distribution for the best-performing models (RF and CatBoost). For the CatBoost model on the test set, 88.47% of li-ion battery samples had prediction errors within ±540 mAh (0.5% of 108 Ah). Moreover, the model correctly identified 89.86% of cells with actual capacities above 108 Ah as meeting the standard. Similarly, the RF model achieved 88.14% of samples within ±540 mAh error and 90.78% correct identification for above-standard cells. These statistics demonstrate the practical utility of our approach for preliminary sorting in production lines. However, absolute capacity prediction errors, though small, could still affect economic outcomes if used for precise binning. Thus, further refinement is needed for high-precision applications.
We employed SHAP (SHapley Additive exPlanations) analysis to interpret the models and understand feature contributions. SHAP values quantify the impact of each feature on individual predictions, aggregated to assess overall importance. Figure 1 summarizes the mean absolute SHAP values for all features in the RF and CatBoost models. Features are ranked by their contribution magnitude. Notably, OCV2 voltage emerged as the most influential feature in both models, indicating that the second open-circuit voltage measurement is a key indicator of li-ion battery state after formation. Jelly roll weights (total, A, B) also showed high positive contributions, aligning with the expectation that active material mass directly correlates with capacity. DCIR appeared as a significant negative influencer, as higher internal resistance typically reduces usable capacity. Formation parameters (temperatures and cutoff voltages) exhibited moderate contributions, especially in CatBoost, suggesting their nonlinear effects on SEI formation and lithium inventory loss.
The importance of OCV2 can be rationalized by considering that it reflects the cell’s equilibrium potential after formation, which depends on electrode lithiation levels and side reactions. Similarly, jelly roll weight is a proxy for active material quantity, a fundamental determinant of capacity. DCIR affects polarization losses during discharge, influencing capacity measurements. Formation temperatures impact SEI growth kinetics; optimal temperatures promote stable SEI, while extremes can cause excessive decomposition. Cutoff voltages during formation control the degree of delithiation in the positive electrode, affecting initial capacity. These insights validate our model’s alignment with li-ion battery electrochemistry principles.
Our study demonstrates that data-driven machine learning models can effectively predict li-ion battery capacity from production line data, potentially reducing reliance on traditional grading. The CatBoost model achieved the highest accuracy, but all algorithms performed reasonably well. The nonlinear relationships captured by these models exceed what linear correlation analysis can reveal, emphasizing the value of advanced analytics in manufacturing. Nevertheless, there are limitations. Our dataset comes from a single production line for a specific li-ion battery type (108 Ah), so model generalizability to other designs or factories requires further validation. Additionally, while prediction errors are small, they may not suffice for high-precision grading without calibration. Future work could integrate more features (e.g., impedance spectroscopy data, electrode porosity) and explore deep learning architectures for enhanced accuracy. Real-time implementation on production lines would also necessitate robust data pipelines and model updating mechanisms.
In conclusion, we have presented a comprehensive framework for li-ion battery capacity grading using production line data and machine learning. By leveraging over 20,000 data points, we trained multiple models that predict capacity with errors below 0.35% of the standard value. Feature importance analysis revealed critical parameters like OCV2 voltage and jelly roll weight, offering guidance for process optimization. This approach holds promise for simplifying li-ion battery manufacturing, cutting costs, and improving throughput. As the demand for li-ion batteries continues to grow, such data-driven innovations will be pivotal in advancing sustainable energy storage solutions.
From a broader perspective, the integration of machine learning into li-ion battery production aligns with Industry 4.0 trends, where smart factories leverage data for predictive maintenance and quality control. Our method can be extended to predict other cell characteristics, such as cycle life or safety indicators, fostering a holistic data ecosystem. Moreover, the principles discussed here apply not only to li-ion batteries but also to other battery chemistries, underscoring the versatility of data-driven approaches. We envision that future li-ion battery plants will employ real-time analytics dashboards, where models like ours provide instant feedback on cell quality, enabling adaptive process adjustments and reducing waste.
To further elucidate the mathematical underpinnings, we can formalize the machine learning problem. Let the production data for each li-ion battery be represented as a feature vector \(\mathbf{x} \in \mathbb{R}^{20}\), and the corresponding capacity as \(y \in \mathbb{R}\). We seek a function \(f: \mathbb{R}^{20} \rightarrow \mathbb{R}\) that minimizes the expected prediction error. The ensemble models used approximate \(f\) by combining multiple base learners. For example, CatBoost constructs a sequence of decision trees \(h_t(\mathbf{x})\) such that:
$$ f(\mathbf{x}) = \sum_{t=1}^{T} \eta h_t(\mathbf{x}) $$
where \(\eta\) is the learning rate and \(T\) is the number of trees. Each tree \(h_t\) is trained to correct the residuals of the previous trees, optimizing a loss function \(L(y, f(\mathbf{x}))\), often mean squared error for regression. The optimization involves gradient descent in function space, with careful handling of overfitting through regularization. Similarly, RF aggregates predictions from \(B\) independent trees:
$$ f(\mathbf{x}) = \frac{1}{B} \sum_{b=1}^{B} h_b(\mathbf{x}) $$
where each tree \(h_b\) is grown on a bootstrap sample of the data with random feature selection. These algorithms excel at capturing interactions among features, which are prevalent in li-ion battery data due to complex electrochemical processes.
We also considered the economic implications of implementing our model. By reducing or eliminating the grading step, manufacturers could save on equipment costs, energy consumption, and production time. Assuming a typical grading cycle takes 5 hours per cell and a production line outputs 10,000 cells per day, even a 10% reduction in grading time could free up significant resources. Moreover, predictive grading allows for early detection of out-of-spec cells, enabling corrective actions upstream and reducing scrap rates. For li-ion battery gigafactories, such efficiencies translate into substantial competitive advantages.
In summary, this work contributes to the growing body of research on data-driven manufacturing for li-ion batteries. We have shown that machine learning models, particularly CatBoost, can accurately predict capacity from routine production data. The insights gained from feature analysis can inform process improvements, while the methodology itself offers a blueprint for other predictive tasks in battery manufacturing. As li-ion battery technology evolves, continuous data collection and model refinement will be essential to keep pace with new materials and designs. We believe that our approach represents a step toward more intelligent and sustainable li-ion battery production, ultimately supporting the global transition to clean energy.
