Lithium battery capacity prediction method, model acquisition method, device, equipment and medium
By generating synthetic samples in the lithium battery capacity prediction model, the problem of low prediction accuracy caused by uneven battery capacity distribution is solved, and high-precision prediction of sparse regions is achieved, thereby improving the production efficiency and reliability of lithium battery quality control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN BAK POWER BATTERY CO LTD
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-21
AI Technical Summary
Existing lithium battery capacity prediction models suffer from insufficient fitting of sparse intervals and low prediction accuracy when faced with uneven battery capacity distribution, especially in high-end product grading and consistency screening scenarios where they cannot meet the high accuracy requirements.
By acquiring process data and capacity label data from the lithium battery manufacturing process, characteristic information representing the state of lithium batteries is extracted, minority class samples in the edge interval of capacity distribution are identified, synthetic samples are generated, and the capacity prediction model is trained using the initial training sample set and synthetic samples, thereby improving the model's representativeness and learning ability in sparse regions.
It significantly improves the data representativeness and learning ability of the prediction model in the high and low capacity ranges, reduces the resource consumption and production cost of the capacity grading process, and improves the accuracy of battery quality grading.
Smart Images

Figure CN121901690A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a lithium battery capacity prediction method and model acquisition method, apparatus, equipment and medium. Background Technology
[0002] In the manufacturing process of lithium batteries, the actual usable capacity of the battery typically requires a complete set of processes, including formation and capacity grading, and must be measured through multiple charge-discharge cycles and resting periods to obtain an accurate result. This process is time-consuming, generally taking several to tens of hours, and relies on a large amount of specialized equipment, occupying significant factory space and consuming high amounts of energy, thus significantly increasing production costs and timelines. To improve production efficiency, in recent years, the industry has widely adopted data-driven methods to build capacity prediction models. These models utilize multi-dimensional data such as voltage, current, temperature, and timing behavior collected in early process stages (e.g., the formation and pre-charge stage) to extract characteristic variables that characterize the battery's state, thereby establishing a mapping relationship between early data and final capacity. This type of method can achieve high-precision prediction of capacity grading before the battery completes the entire charge-discharge process, thereby supporting rapid sorting, anomaly warning, and quality control, significantly reducing equipment investment, energy consumption, and production line occupancy time. It has become one of the key technological directions in intelligent manufacturing of lithium batteries.
[0003] While existing methods have achieved good overall prediction performance, significant technical bottlenecks remain in practical applications. Because battery capacity in mass production typically exhibits an approximately normal distribution, the majority of samples fall within the middle capacity range, while batteries with excessively high or low capacities (i.e., marginal groups at the extremes of the distribution) constitute a very small proportion. This leads to severe class imbalance in the training dataset. Under this data distribution, machine learning models tend to optimize the overall loss function, prioritizing the fit to the majority class, resulting in insufficient learning of the minority class. This leads to large prediction biases and poor robustness in the extreme capacity ranges. This issue directly impacts the reliability of the model in critical quality control processes, particularly in scenarios such as high-end product grading and consistency screening, making it difficult to meet the high-precision prediction requirements. Summary of the Invention
[0004] In view of this, the embodiments of this application provide a lithium battery capacity prediction method and model acquisition method, device, equipment and medium, which can effectively solve the problems of insufficient fitting of prediction models to sparse intervals and low prediction accuracy caused by uneven distribution of battery capacity in the prior art.
[0005] In a first aspect, embodiments of this application provide a method for obtaining a lithium battery capacity prediction model, comprising: Obtain process data and corresponding capacity tag data of the target lithium battery during the manufacturing process; Based on the process data, feature information characterizing the state of lithium batteries is extracted, and a feature set is constructed. Based on the capacity label data, a set of minority class samples located in the edge interval of the capacity distribution is identified, and the importance of each feature is determined based on the feature set and a preset feature evaluation model to construct a distance space; In the distance space, synthetic samples are generated based on the feature differences between the minority class sample set and its neighboring samples; The capacity prediction model is trained using the initial training sample set and the synthetic sample set to obtain a target model for lithium battery capacity prediction.
[0006] In some embodiments, acquiring the process data and corresponding capacity tag data of the target lithium battery during manufacturing includes: The pre-charge timing data of the target lithium battery generated during the formation stage is collected from the formation equipment as process data. The actual capacity of the target lithium battery is obtained from the capacity grading device as capacity tag data; Abnormal sample removal is performed on the pre-charge timing data and the capacity tag data to obtain valid process data and valid capacity tag data.
[0007] In some embodiments, the step of extracting feature information characterizing the state of the lithium battery based on the process data and constructing a feature set includes: Extract statistical features, sampling features, derivative peak features, and equivalent circuit parameter features from the process data; Various features are combined to form a multi-dimensional feature vector, and a feature set representing the state of lithium batteries is constructed.
[0008] In some embodiments, the step of identifying a set of minority class samples located in the marginal interval of the capacity distribution based on the capacity label data, and determining the importance of each feature based on the feature set and a preset feature evaluation model to construct a distance space between samples includes: The capacity label data is subjected to distribution analysis to identify samples whose capacity values are below a first threshold or above a second threshold, forming a capacity edge interval sample set, and the capacity edge interval sample set is determined as a minority class sample set. The feature set is input into a preset feature evaluation model to calculate the contribution score of each feature in the capacity prediction task; The contribution scores are normalized to obtain the importance of each feature; Based on the importance, features with an importance greater than a preset threshold are selected to form an important feature subset. Based on the aforementioned important feature subset, a distance space between samples is constructed using weighted Euclidean distance.
[0009] In some embodiments, generating synthetic samples in the distance space based on feature differences between the minority class sample set and neighboring samples includes: At least one sample is randomly selected from the minority class sample set as a seed sample; In the distance space, find the k nearest neighbor samples corresponding to each seed sample; The k nearest neighbor samples are filtered out, and samples whose feature space distance from the seed sample is greater than a first preset threshold or whose capacity difference exceeds a second preset threshold are removed. Based on the filtered neighboring samples, interpolation is performed on the corresponding feature dimensions according to preset weights to generate a synthetic sample containing feature values and capacity values.
[0010] In some embodiments, training the capacity prediction model using an initial training sample set and the synthetic samples to obtain a target model for lithium battery capacity prediction includes: The initial training sample set is merged with the synthetic sample set to construct an enhanced training dataset; The enhanced training dataset is input into a capacity prediction model of a preset type; A grid search is performed for multiple hyperparameter combinations of the model to generate a set of candidate model configurations; The model performance under each configuration is evaluated using cross-validation, and the optimal model is selected as the target model based on preset evaluation metrics.
[0011] Secondly, embodiments of this application provide a method for predicting the capacity of a lithium battery, including: The lithium battery to be tested is input into the target model to obtain the corresponding capacity prediction value; wherein the target model is obtained by the method described in any one of the first aspects.
[0012] Thirdly, embodiments of this application provide a device for obtaining a lithium battery capacity prediction model, comprising: The data acquisition module is used to acquire process data and corresponding capacity tag data of the target lithium battery during the manufacturing process; The feature construction module is used to extract feature information characterizing the state of lithium batteries based on the process data and construct a feature set; The importance assessment module is used to identify a set of minority class samples located in the marginal interval of the capacity distribution based on the capacity label data, and to determine the importance of each feature based on the feature set and the preset feature assessment model, and to construct a distance space between samples. A sample processing module is used to generate synthetic samples in the distance space based on the feature differences between the minority class sample set and the corresponding samples; The model training module is used to train the capacity prediction model using the initial training sample set and the synthetic sample to obtain a target model for lithium battery capacity prediction.
[0013] Fourthly, embodiments of this application provide a terminal device, the terminal device including a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method for obtaining the lithium battery capacity prediction model described in the first aspect above.
[0014] Fifthly, embodiments of this application provide a computer-readable storage medium, wherein when the computer program is executed on a processor, it implements the method for obtaining the lithium battery capacity prediction model described in the first aspect.
[0015] The embodiments of this application have the following beneficial effects: This application effectively alleviates the problem of underfitting of the model to low-frequency samples caused by uneven capacity distribution, significantly improves the data representativeness and learning ability of the prediction model in the high and low capacity ranges, and enhances the overall generalization performance of the model; through the distance measurement mechanism guided by feature importance, the rationality and consistency of the synthesized samples in a physical sense are ensured; the generated enhanced data reduces the mean absolute error (MAE) of the target model in the sparse region by 7%-11%, improves the accuracy of battery quality grading, reduces the resource consumption and production cost of the capacity grading process, and has good industrial application value. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart of a method for obtaining a lithium battery capacity prediction model according to an embodiment of this application is shown; Figure 2 Another flowchart is shown in the method for obtaining the lithium battery capacity prediction model according to an embodiment of this application; Figure 3 This paper illustrates another flowchart of a method for obtaining a lithium battery capacity prediction model according to an embodiment of this application. Figure 4 A schematic diagram of a device for obtaining a lithium battery capacity prediction model according to an embodiment of this application is shown. Detailed Implementation
[0018] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0019] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0020] In the following text, the terms "comprising," "having," and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more combinations thereof. Furthermore, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0021] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0022] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0023] Considering the problems of insufficient fitting and low prediction accuracy of existing prediction models for sparse intervals due to uneven battery capacity distribution, a method for obtaining lithium battery capacity prediction models is proposed. By introducing a synthetic minority class sample mechanism guided by feature importance, data augmentation is performed in key edge regions to improve the representativeness and balance of the training set, thereby improving the model's generalization ability at both ends of the capacity distribution and achieving high-precision prediction of extreme capacity values. This provides more reliable support for quality grading and process control in intelligent manufacturing of lithium batteries.
[0024] The following examples illustrate the method for obtaining the lithium battery capacity prediction model.
[0025] Figure 1 A flowchart illustrating a method for obtaining a lithium battery capacity prediction model according to an embodiment of this application is shown. Exemplarily, the method for obtaining the lithium battery capacity prediction model includes the following steps: Step S100: Obtain the process data and corresponding capacity tag data of the target lithium battery during the manufacturing process.
[0026] Among them, process data refers to multidimensional time-series or statistical information collected by equipment during the lithium battery production process, reflecting the physical and electrochemical behavior of the cell, including process parameters such as voltage, current, temperature, and capacity that change over time; capacity label data refers to the final usable capacity value of the battery measured through a standard capacity grading process, serving as the true label in supervised learning. Demonstratively, the basic data pairs required to construct the prediction model provide a basis for subsequent feature extraction and modeling.
[0027] In an optional embodiment, step S100 includes the following sub-steps: S101, collect the pre-charge timing data of the target lithium battery generated during the formation stage from the formation equipment as process data.
[0028] The formation equipment refers to a dedicated power system used to perform the first charge-discharge activation process of lithium batteries, possessing high-precision voltage / current sampling capabilities. Pre-charge timing data refers to a dynamic signal sequence recorded in the formation process, arranged by timestamps, typically covering multiple stages such as constant voltage charging, resting, constant voltage charging, resting, and constant current / constant voltage charging. Demonstratively, the data stream uploaded from the formation cabinet is read in real time using industrial communication protocols (such as Modbus TCP or OPC UA). For each cell (uniquely identified by its ID number), key variables such as voltage (V), current (A), temperature (°C), and cumulative charging capacity (mAh) are collected throughout the pre-charge process, forming a multi-channel timing curve containing thousands of time points.
[0029] For example, the transformation process lasts about 3 hours, with data collected once per second, resulting in about 10,800 time points. This raw data is then archived by cell ID and cached in a local database.
[0030] S102, Obtain the actual capacity of the target lithium battery from the capacity grading device as capacity tag data.
[0031] Capacity grading equipment refers to a testing system used to accurately measure the rated capacity of a battery. It typically employs a complete charge-discharge cycle to determine the battery's true usable energy. Actual capacity grading refers to the total amount of electricity released after a complete charge-discharge cycle under standard temperature control conditions, measured in mAh or Ah, and offers high measurement accuracy. For example, after a battery cell completes its entire formation process, it is sent to a capacity grading channel for a standard test lasting 8-12 hours. The equipment performs constant current and constant voltage charging to the cutoff voltage, then discharges at a specified rate to the termination voltage, recording the total capacity value output throughout the discharge process. This value is then transmitted back through the MES system and bound to the cell's ID, being written into a unified data table.
[0032] S103, abnormal sample removal processing is performed on the pre-charge timing data and capacity tag data to obtain valid process data and valid capacity tag data.
[0033] Abnormal samples refer to data distortion caused by equipment failure, communication interruption, sensor drift, or operational errors, manifesting as voltage jumps, current zeroing, temperature exceeding limits, or significant capacity deviations from the normal distribution. As an example, integrity checks are performed on each pre-charge timing data entry: if a cell's voltage curve exhibits an unexpected surge or oscillation during the constant voltage phase (e.g., exceeding the ±50mV noise threshold), or if the current remains stagnant at 0A for more than 10 minutes, it is considered abnormal; simultaneously, the corresponding capacity label is checked to see if it is empty, negative, or outside a reasonable range (e.g., below 2400mAh or above 2800mAh). Once any of these abnormalities are found, the entire record for that cell is marked as invalid and removed from the training set.
[0034] For example, in a batch of 100,000 battery cells, an average of about 1.2% of the samples were identified as abnormal due to broken circuits or misjudgment of capacity. After cleaning, 98,800 sets of valid data were retained.
[0035] In other implementations, for data with only minor missing information (such as data missing at individual time points), linear interpolation or pre- and post-value padding can be used to repair the data instead of directly removing it, in order to retain the most usable samples.
[0036] Step S200: Extract feature information characterizing the state of lithium batteries based on process data and construct a feature set.
[0037] Feature information refers to quantitative indicators that reflect the internal electrochemical characteristics of a battery, extracted through mathematical transformations and pattern recognition of the original data. The feature set is a multidimensional vector composed of multiple features, used as input variables for machine learning models. Demonstratively, high-dimensional, redundant raw time-series data is transformed into compact, interpretable, and predictive structured features, thereby improving the learning efficiency and generalization ability of subsequent models.
[0038] In an optional embodiment, step S200 includes the following sub-steps: S201, extract statistical features, sampling features, derivative peak features, and equivalent circuit parameter features from the process data.
[0039] Among them, statistical features refer to the indicators of central tendency, dispersion and distribution pattern of voltage, current or temperature sequences within a certain step; sampling features refer to the key parameter values extracted at specific time points or event nodes; derivative peak features refer to the peak position and peak height information in the dQ / dV curve obtained based on differential operations, reflecting the lithium-ion insertion / deintercalation phase transition process; equivalent circuit parameter features refer to the RC network parameters obtained by fitting the voltage relaxation behavior of the battery during the resting stage, characterizing the battery's internal resistance and polarization characteristics.
[0040] In a demonstrative manner, the pre-charge timing data is processed in steps: for the first constant-voltage charging stage, the mean, standard deviation, maximum, minimum, skewness, and kurtosis of the voltage are calculated as statistical features; for the constant-current charging stage, the corresponding voltage values are recorded at 300 seconds, 600 seconds, and 900 seconds as sampling features; then, the dQ and dV during constant-voltage charging are numerically differentiated to generate the dQ / dV-voltage curve, and the voltage value and peak height corresponding to the first peak are extracted as derivative-type peak features; finally, in each resting stage (e.g., 10 minutes), a first-order equivalent circuit model is used. By fitting the voltage decay curve, the open-circuit voltage can be solved. Polarization amplitude and time constant As a feature of equivalent circuit parameters.
[0041] S202 combines various features to form a multi-dimensional feature vector, constructing a feature set that characterizes the state of lithium batteries.
[0042] In this context, a multidimensional feature vector refers to a numerical array formed by concatenating all extracted features of the same battery cell in a fixed order, with each dimension corresponding to a specific feature. For example, the 128-dimensional features of each battery cell are arranged into a column vector according to a preset order (e.g., statistical class, sampling class, derivative class, and equivalent circuit class), and stored in the feature database using the battery cell ID as an index. The feature vectors of all samples ultimately form a... The characteristic matrix ( (This represents the total number of samples). This feature set not only preserves the key physical meaning of the original data, but also possesses good numerical stability and model compatibility.
[0043] For example, in actual project testing, after using this feature set as input into the LightGBM model, the mean absolute error (MAE) of the 10-fold cross-validation decreased by about 18% compared to before feature extraction, verifying the effectiveness of feature engineering.
[0044] In other implementations, the feature extraction range can be adjusted according to the process differences of different cell models. For example, more dQ / dV feature dimensions can be added for high-nickel system cells, while the extraction of temperature-related features can be strengthened for lithium iron phosphate system cells, in order to adapt to the modeling needs of different material systems.
[0045] Step S300: Identify the minority class sample set located in the marginal interval of capacity distribution based on capacity label data, and determine the importance of each feature based on the feature set and the preset feature evaluation model to construct a distance space.
[0046] Among them, the minority class sample set refers to the cell samples that are few in number in the overall capacity distribution and are located in the extreme range of low or high capacity. Due to their insufficient data volume, they are prone to underfitting the model. The feature evaluation model is a machine learning model used to quantify the contribution of each input feature to the prediction task. The distance space is a multi-dimensional quantitative space constructed based on selected features, used to measure the similarity between different samples. Exemplarily, this step provides two key foundations for subsequent sample synthesis: first, to identify the data region that needs to be enhanced (i.e., the sparse region), and second, to establish a similarity judgment mechanism that can reflect physical correlation, ensuring that the generated new samples are reasonable and representative.
[0047] In one alternative embodiment, such as Figure 2 As shown, step S300 includes the following sub-steps: S301, Perform distribution analysis on the capacity label data, identify samples with capacity values below the first threshold or above the second threshold, form a capacity edge interval sample set, and determine the capacity edge interval sample set as the minority class sample set.
[0048] Among them, distribution analysis refers to statistically analyzing the frequency distribution characteristics of all sample size values, which usually presents an approximate normal distribution shape; the first threshold and the second threshold are used to define the boundaries between the low-size end and the high-size end, respectively, and samples outside this range are considered as marginal groups.
[0049] As an example, valid capacity label data after cleaning was read, and a capacity distribution histogram was plotted. It was found that most cells were concentrated in the [2590, 2650] mAh range, while the number of samples in the [2560, 2590] mAh (Grade A) and [2650, 2680] mAh (Grade D) ranges was significantly smaller, accounting for less than 8% of the total samples. Based on this, a first threshold of 2590 mAh and a second threshold of 2650 mAh were set. All samples with capacities less than 2590 mAh or greater than 2650 mAh were selected to form the initial capacity edge range sample set, which was then formally marked as the minority class sample set.
[0050] S302, input the feature set into the preset feature evaluation model, and calculate the contribution score of each feature in the capacity prediction task.
[0051] The contribution score refers to the sum of information gains brought about by a feature participating in decision splitting during model training, reflecting its influence on the prediction results.
[0052] As an example, the aforementioned construction The feature matrix and its corresponding capacity label vector are input into the LightGBM regression model for initial training (only used for feature importance extraction, not as the final prediction model). When the model splits at each node of the decision tree, it evaluates the splitting effect of each feature based on the decrease in mean squared error (MSE) and accumulates the total contribution of each feature in the entire forest. For example, in one round of training, the dQ / dV peak height feature in the first constant-pressure stage frequently appears at high-level splitting nodes, resulting in a cumulative information gain of 0.032, far exceeding the temperature mean (0.0015), indicating a stronger discriminative ability for capacity prediction.
[0053] S303 normalizes the contribution scores to obtain the importance of each feature.
[0054] Normalization involves converting the original contribution scores into relative weights within the [0,1] interval, ensuring that the sum of the importance of all features equals 1, facilitating comparison and application. As an example, 128 original contribution values from the LightGBM output are collected, and their sum is calculated. Then perform on each feature The operation yields a standardized list of importance.
[0055] S304. Based on importance, select features with importance greater than a preset threshold to form an important feature subset.
[0056] The important feature subset refers to a set of features selected from the original feature set that have a significant impact on the prediction task, used to reduce noise interference and improve distance calculation efficiency. For example, a preset threshold of 0.0001 is set, and the normalized feature importance list is iterated through, retaining all feature dimensions greater than this threshold. After filtering, the original 128-dimensional features are compressed to 37 dimensions, forming the important feature subset. This subset mainly includes: dQ / dV peak voltage, equivalent circuit time constant, etc. Key indicators with clear physical meanings, such as the rate of current decay at the end of the constant voltage period and the voltage difference during the resting stage.
[0057] S305 uses a weighted Euclidean distance to construct the distance space between samples based on important feature subsets.
[0058] Weighted Euclidean distance introduces feature weighting factors into the traditional Euclidean distance formula, giving more weight to important features in the distance calculation and thus more accurately reflecting the correlation between samples. As an example, all features within the important feature subset are normalized (e.g., Min-Max scaling to the [0,1] interval) to eliminate dimensional differences; then the weighted distance function is defined as follows:
[0059] Where x1 represents the minority class sample, and x2 represents the overall sample. and This is the i-th important feature.
[0060] Step S400: In the distance space, based on the feature differences between the minority class sample set and neighboring samples, a synthetic sample is generated.
[0061] Here, the distance space refers to a weighted Euclidean distance metric space constructed based on important feature subsets, used to measure the similarity between samples; the nearest neighbor sample refers to the group of samples in this distance space that is closest to the seed sample; and the synthetic sample refers to new, reasonable virtual data points constructed through interpolation to expand the training data in sparse regions. Demonstratively, by controlling the expansion of real minority class samples, the underfitting problem caused by insufficient samples can be alleviated, and the generalization ability of the prediction model to extreme capacity values can be improved.
[0062] In one alternative embodiment, such as Figure 3 As shown, step S400 includes the following sub-steps: S401, randomly select at least one sample from the minority class sample set as a seed sample.
[0063] Here, the seed sample refers to a real-world battery cell sample randomly selected from the minority class sample set, serving as the starting point or benchmark for synthesizing new samples. Exemplarily, the labeled minority class sample set (e.g., cells with capacities <2590 mAh or >2650 mAh) is traversed, and a pseudo-random number generator is used to select samples one by one as seeds in a uniform distribution. For example, in a batch processing, the battery cell numbered BKC-20250901-10387 is selected sequentially as the seed sample for the current round; its original feature vector and capacity label will serve as the basis for subsequent interpolation operations.
[0064] S402, in the distance space, find the k nearest neighbors of each seed sample.
[0065] Here, the k nearest neighbors refer to the k nearest sample points to the seed sample in the weighted distance space, typically searched using the KNN (k-Nearest Neighbors) algorithm. As an example, a pre-constructed distance matrix is invoked to query the k nearest neighbors to the current seed sample, where k is 5 (experiments have shown this value strikes a balance between diversity and stability). These neighboring samples can come from the entire sample set, not just the minority classes themselves, thus allowing for reasonable information fusion across sample types. For example, for a low-capacity seed sample, its five nearest neighbors might include four marginal samples of the same class and one sample of medium capacity but with similar polarization characteristics, indicating that their physical behaviors share certain commonalities.
[0066] S403, filter the k neighboring samples and remove samples whose distance from the seed sample in the feature space is greater than the first preset threshold, or whose capacity difference exceeds the second preset threshold.
[0067] The first preset threshold controls the similarity at the feature level, preventing the selection of abnormal neighbors with excessively large feature differences. The second preset threshold limits the span of capacity values, avoiding label drift caused by invalid interpolation across intervals. For example, the first preset threshold is set to 30% of the maximum distance after normalization (i.e., if the maximum distance is 1.0, the threshold is 0.3), retaining only neighboring samples whose weighted Euclidean distance to the seed sample is less than this value. Simultaneously, the second preset threshold is set to an absolute capacity difference ≤ 15 mAh; samples exceeding this range are discarded. For instance, if a neighboring sample is close to the seed sample in equivalent circuit parameters but its actual capacity is 40 mAh higher, it is determined not to belong to the same group and is not included in the synthesis. As an example, after this double screening, an average of 3.2 of the original 5 neighboring samples are retained, significantly improving the quality and rationality of subsequent interpolation.
[0068] S404, based on the filtered neighboring samples, performs interpolation operations on the corresponding feature dimensions according to preset weights to generate a synthetic sample containing feature values and capacity values.
[0069] The preset weight refers to the control coefficient for the magnitude of change during the interpolation process, which is reflected as the step size factor. This is used to adjust the deviation between the new sample and the original sample; interpolation refers to generating new data points between two samples along a linear path. As an example, for each retained neighboring sample, the following operation is performed:
[0070]
[0071]
[0072] in, and For the feature values and capacity values of the new sample, and The weight value belongs to [0,1]. It can be set to a very small decimal, such as 0.0000001, etc., which is just one example.
[0073] For example, when At this time, the important feature values of the new sample are located between the seed sample and its neighbors, closer to the former, effectively maintaining the continuity of battery properties; while redundant feature dimensions can be assigned higher perturbation weights (e.g., Alternatively, it can directly inherit values from neighboring samples to increase diversity. The resulting new samples have a clear causal chain with their parents, and the overall distribution tends to smoothly fill the original sparse regions.
[0074] In other implementations, if it is necessary to control the total number of synthesized samples, the total number of synthesized samples can be set to be equal to the original minority class sample size, or dynamically adjusted according to the class imbalance ratio; furthermore, It can be set to a fixed value or in layers to adapt to the expanded needs under different material systems or process conditions.
[0075] In one optional implementation, step S404 includes the following sub-steps: For each target feature dimension, a first weight parameter and a second weight parameter are set. The first weight parameter and the second weight parameter are used to control the interpolation ratio of important features and unimportant features, respectively.
[0076] The first weight parameter refers to the interpolation coefficient applied to the important feature dimensions. The first weight parameter, whose value ranges from [0.1, 0.5], is used to limit the variation range of key features and ensure that the newly generated samples are physically consistent with the original minority class samples. The second weight parameter refers to the interpolation coefficient applied to the dimensions of non-important features (i.e., redundant or low-contribution features). Its value ranges from [0.5, 1.0], allowing for greater perturbation to enhance data diversity.
[0077] As an example, features are divided into two categories based on a feature importance list: important features (such as dQ / dV peak height, equivalent circuit time constant) And unimportant features (such as certain temperature deviation terms or sampling point voltages). Then, when performing interpolation, a smaller first weight parameter (e.g., ...) is used for dimensions that belong to important features. This ensures that the feature values of the new sample fluctuate only within a small range around the original seed sample; while for unimportant features, a larger second weight parameter (such as...) is used. Alternatively, it can directly inherit the values of neighboring samples, thereby introducing moderate variation without affecting the overall performance trend.
[0078] Based on the first and second weight parameters, a capacity interpolation weight is constructed, and joint interpolation is performed on the seed sample and neighboring samples to generate the feature value and capacity value of the synthetic sample.
[0079] Here, capacity interpolation weights refer to the interpolation ratio used when synthesizing capacity labels. They are typically set to be consistent with or related to the main control weights in feature interpolation to ensure logical consistency between features and labels. As an example, capacity interpolation weights are set. Equal to the important features used ,Right now:
[0080] This design ensures that the pace of capacity changes matches the changes in key features, avoiding the unreasonable situation where features are similar but capacity jumps.
[0081] For example, when a new sample is in When only a small shift occurs in high-importance features such as dQ / dV peak positions, the prediction capacity should also be adjusted only slightly, rather than abruptly changing across intervals.
[0082] Step S500: Train the capacity prediction model using the initial training sample set and the synthetic sample set to obtain the target model for lithium battery capacity prediction.
[0083] The initial training sample set refers to the collection of real battery data after cleaning and feature extraction, containing original process features and their corresponding capacity labels. The capacity prediction model is a regression model built based on machine learning algorithms, used to establish a non-linear mapping relationship between early process features and final capacity. The target model is the optimal model after training and optimization, possessing high accuracy and strong generalization ability, and can be used to predict the capacity of new batches of battery cells online. Demonstratively, the original data and augmented data are fused to improve the model's fitting ability to edge capacity ranges, ultimately outputting a target model that is stable in overall distribution and accurate in predicting key areas.
[0084] In an optional embodiment, step S500 includes the following sub-steps: S501, merge the initial training sample set with the synthetic sample set to construct an enhanced training dataset.
[0085] The augmented training dataset refers to a joint training set composed of original real samples and newly added synthetic samples, aiming to improve the balance of sample distribution. For example, the initial training sample set (e.g., 98,800 valid samples) is read, and then the synthetic samples generated through step S400 (e.g., 14,500, a number comparable to the minority class samples) are loaded. Their feature vectors and capacity labels are then concatenated in a uniform format to form a new training dataset. dimensional training matrix ( All samples retain their cell ID and are labeled with their original / synthetic origin for easy tracking and analysis later.
[0086] For example, in the N21700CN-5.0 battery cell project, the proportion of minority class samples increased from about 14.7% to nearly 25% after merging, which significantly alleviated the class imbalance problem and provided the model with more sufficient learning signals.
[0087] S502, input the enhanced training dataset into the capacity prediction model of the preset type.
[0088] Among them, the capacity prediction model refers to one or more machine learning algorithms suitable for regression tasks. In this embodiment, LightGBM (Light Gradient Boosting Machine) is preferred because it has advantages such as fast training speed, strong anti-overfitting ability, and support for high-dimensional sparse features.
[0089] As an example, a LightGBM regressor instance is initialized, configured with basic parameters (e.g., objective function is MSE, learning rate is 0.1, maximum tree depth is 6), and the augmented training dataset is divided into a training subset (80%) and a validation subset (20%). The training subset is used for model fitting, and the validation subset is used to monitor performance changes. For instance, each sample input to the model is a 128-dimensional feature vector (including statistical, sampling, dQ / dV, and equivalent circuit parameter classes), labeled with the corresponding actual capacity (unit: mAh). The model learns the complex nonlinear relationship between various feature combinations and capacity through multiple iterations.
[0090] S503 performs a grid search for multiple hyperparameter combinations of the model to generate a set of candidate model configurations.
[0091] Hyperparameters are control parameters that need to be manually set before model training, unlike weights that are automatically learned by the model. Grid search is an exhaustive hyperparameter tuning method that traverses all possible combinations in a predefined parameter space to find the optimal configuration. For example, the candidate ranges for the following key hyperparameters can be defined: Learning rate: [0.05, 0.1, 0.15] Number of trees (n_estimators): [100, 200, 300] Maximum tree depth (max_depth): [5,6,7) Feature subset ratio (colsample_bytree): [0.8, 0.9, 1.0] This generates a common A set of candidate model configurations is formed by combining various parameters. Each configuration will be used to independently train a LightGBM model, and its performance on the validation set will be recorded.
[0092] S504 evaluates the model performance under each configuration based on the cross-validation method, and selects the optimal model as the target model according to the preset evaluation index.
[0093] The cross-validation method refers to k-fold cross-validation (5-fold CV in this example), which randomly divides the training data into 5 parts, uses 4 parts for training and 1 part for validation in turn, and finally takes the average of the 5 results as the performance score of the configuration to reduce random bias. The preset evaluation indicators include mean absolute error (MAE), root mean square error (RMSE) and coefficient of determination (R²). In this embodiment, MAE is the main selection criterion.
[0094] As an example, 5-fold cross-validation was performed on each of the 81 configurations mentioned above, and the average MAE of the model under each configuration was calculated.
[0095] For example, a certain set of parameters (learning_rate=0.1, n_estimators=200, max_depth=6) achieved an average MAE of 12.3 mAh in 5-fold validation, outperforming other combinations. Based on this, it was determined to be the optimal configuration, and a complete model was retrained using all the augmented training data as the final target model. For instance, in actual testing, compared to the control model without synthetic samples, the target model in this embodiment showed a decrease in MAE of approximately 7%-11% in the minority class interval (A / D rank), validating the effectiveness of data augmentation.
[0096] In other implementations, if computational resources are limited, random search or Bayesian optimization can be used instead of grid search to improve parameter tuning efficiency. In addition, XGBoost, CatBoost or neural networks can be selected as alternative model types to compare performance and make appropriate choices in different application scenarios.
[0097] This application also provides a lithium battery capacity prediction method, which, by way of example, includes: inputting the lithium battery to be tested into a target model to obtain the corresponding capacity prediction value; wherein the target model is obtained using the method described in the above embodiments.
[0098] Figure 4 A schematic diagram of a device for obtaining a lithium battery capacity prediction model according to an embodiment of this application is shown. Exemplarily, the device 100 includes: The data acquisition module 110 is used to acquire the process data and corresponding capacity tag data of the target lithium battery during the manufacturing process; Feature construction module 120 is used to extract feature information characterizing the state of lithium battery based on the process data and construct a feature set; The importance assessment module 130 is used to identify a set of minority class samples located in the edge interval of the capacity distribution based on the capacity label data, and to determine the importance of each feature based on the feature set and the preset feature assessment model, and to construct a distance space between samples. The sample processing module 140 is used to generate synthetic samples in the distance space based on the feature differences between the minority class sample set and the corresponding samples; The model training module 150 is used to train a capacity prediction model using an initial training sample set and the synthetic sample set to obtain a target model for lithium battery capacity prediction.
[0099] It is understood that the apparatus of this embodiment corresponds to the method of the above embodiments, and the options in the above embodiments are also applicable to this embodiment, so they will not be described again here.
[0100] This application also provides a terminal device, exemplary of which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to enable the terminal device to perform the functions of the various modules in the above-described method or apparatus.
[0101] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0102] The memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory is used to store computer programs, and the processor can execute the computer programs accordingly after receiving execution instructions.
[0103] This application also provides a computer-readable storage medium for storing the computer program used in the aforementioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0104] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0105] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0106] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0107] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for obtaining a lithium battery capacity prediction model, characterized in that, The method includes: Obtain process data and corresponding capacity tag data of the target lithium battery during the manufacturing process; Based on the process data, feature information characterizing the state of lithium batteries is extracted, and a feature set is constructed. The minority class sample set located at the edge of the capacity distribution is identified based on the capacity label data, and the importance of each feature is determined based on the feature set and the preset feature evaluation model to construct a distance space. In the distance space, synthetic samples are generated based on the feature differences between the minority class sample set and its neighboring samples; The capacity prediction model is trained using the initial training sample set and the synthetic sample set to obtain a target model for lithium battery capacity prediction.
2. The method for obtaining the lithium battery capacity prediction model according to claim 1, characterized in that, The acquisition of process data and corresponding capacity tag data of the target lithium battery during manufacturing includes: The pre-charge timing data of the target lithium battery generated during the formation stage is collected from the formation equipment as process data. The actual capacity of the target lithium battery is obtained from the capacity grading device as capacity tag data; Abnormal sample removal is performed on the pre-charge timing data and the capacity tag data to obtain valid process data and valid capacity tag data.
3. The method for obtaining the lithium battery capacity prediction model according to claim 1, characterized in that, The step of extracting feature information characterizing the state of lithium batteries based on the process data and constructing a feature set includes: Extract statistical features, sampling features, derivative peak features, and equivalent circuit parameter features from the process data; Various features are combined to form a multi-dimensional feature vector, and a feature set representing the state of lithium batteries is constructed.
4. The method for obtaining the lithium battery capacity prediction model according to claim 1, characterized in that, The step of identifying a set of minority class samples located at the edge of the capacity distribution based on the capacity label data, and determining the importance of each feature based on the feature set and a preset feature evaluation model to construct a distance space between samples includes: The capacity label data is subjected to distribution analysis to identify samples whose capacity values are below a first threshold or above a second threshold, forming a capacity edge interval sample set, and the capacity edge interval sample set is determined as a minority class sample set. The feature set is input into a preset feature evaluation model to calculate the contribution score of each feature in the capacity prediction task; The contribution scores are normalized to obtain the importance of each feature; Based on the importance, features with an importance greater than a preset threshold are selected to form an important feature subset. Based on the aforementioned important feature subset, a distance space between samples is constructed using weighted Euclidean distance.
5. The method for obtaining the lithium battery capacity prediction model according to claim 1, characterized in that, In the distance space, generating synthetic samples based on the feature differences between the minority class sample set and neighboring samples includes: At least one sample is randomly selected from the minority class sample set as a seed sample; In the distance space, find the k nearest neighbor samples corresponding to each seed sample; The k nearest neighbor samples are filtered out, and samples whose feature space distance from the seed sample is greater than a first preset threshold or whose capacity difference exceeds a second preset threshold are removed. Based on the filtered neighboring samples, interpolation is performed on the corresponding feature dimensions according to preset weights to generate a synthetic sample containing feature values and capacity values.
6. The method for obtaining the lithium battery capacity prediction model according to claim 1, characterized in that, The process of training a capacity prediction model using an initial training sample set and the synthetic samples to obtain a target model for lithium battery capacity prediction includes: The initial training sample set is merged with the synthetic sample set to construct an enhanced training dataset; The enhanced training dataset is input into a capacity prediction model of a preset type; A grid search is performed for multiple hyperparameter combinations of the model to generate a set of candidate model configurations; The model performance under each configuration is evaluated using cross-validation, and the optimal model is selected as the target model based on preset evaluation metrics.
7. A method for predicting the capacity of a lithium battery, characterized in that, The method includes: The lithium battery to be tested is input into the target model to obtain the corresponding capacity prediction value; wherein, the target model is obtained by the method described in any one of claims 1-6.
8. A device for acquiring a lithium battery capacity prediction model, characterized in that, include: The data acquisition module is used to acquire process data and corresponding capacity tag data of the target lithium battery during the manufacturing process; The feature construction module is used to extract feature information characterizing the state of lithium batteries based on the process data and construct a feature set; The importance assessment module is used to identify a set of minority class samples located in the marginal interval of the capacity distribution based on the capacity label data, and to determine the importance of each feature based on the feature set and the preset feature assessment model, and to construct a distance space between samples. A sample processing module is used to generate synthetic samples in the distance space based on the feature differences between the minority class sample set and the corresponding samples; The model training module is used to train the capacity prediction model using the initial training sample set and the synthetic sample to obtain a target model for lithium battery capacity prediction.
9. A terminal device, characterized in that, The terminal device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method for obtaining the lithium battery capacity prediction model according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed on a processor, implements the method for obtaining the lithium battery capacity prediction model according to any one of claims 1-7.