Model training and substandard battery cell identification method based on prediction precision

By adopting a model training method based on prediction accuracy in the iron lithium battery cell capacity prediction technology, dynamically divide data intervals and train multiple classification models, the problem of poor cell leakage and overkill in the existing technology is solved, and higher prediction accuracy and more reliable cell recognition results are achieved.

CN119646562APending Publication Date: 2025-03-18SHENZHEN BAK POWER BATTERY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411519771.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The existing iron lithium battery cell capacity prediction technology has shortcomings in balancing leakage and overkill, which leads to the problem of battery cells being mistakenly eliminated or potential problems in the actual production process.

Method used

A model training method based on prediction accuracy is adopted. By obtaining sample data and setting interval division conditions according to the preset error demand value, the data is dynamically divided, multiple classification models are trained, and the best classification model is selected based on the model's score value. Finally, the battery cell capacity is predicted through the best classification model, and the results exceeding the data interval are eliminated to avoid missed and overkill.

Benefits of technology

By dynamically adjusting the division values ​​and training multiple classification models, the leakage and overkill phenomena of the battery cell can be effectively balanced on the basis of improving the prediction accuracy, and the accuracy and reliability of the data prediction results can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646562A_ABST
    Figure CN119646562A_ABST
Patent Text Reader

Abstract

A prediction precision-based model training and substandard battery cell identification method comprises the following steps: setting an interval division condition according to prediction precision to obtain an initial division value; training a plurality of classification models according to the obtained initial division value to obtain an optimal classification model and a final division value; obtaining each data interval according to the obtained final division value; and classifying the training set and the prediction set through the optimal classification model, then obtaining a data prediction result of each data interval according to the classified training set and prediction set, and further identifying the substandard battery cell according to the obtained data prediction result. The data interval division based on the prediction precision can obtain a more detailed data division result, and the optimal classification model is combined to perform data prediction, so that the prediction precision of the final data prediction result can be ensured, missed killing is avoided, over-killing is further reduced on the basis, and the prediction accuracy of the data prediction result is improved. Therefore, the phenomena of omission and omission in the actual production process are balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of substandard battery cell identification, and in particular to a model training based on prediction accuracy and a substandard battery cell identification method. Background Art

[0002] Lithium iron battery is a lithium-ion battery with high energy density, long life, low self-discharge rate and high safety performance. Therefore, it is widely used in electric vehicles, energy storage systems and electric bicycles. At present, the capacity prediction technology of lithium iron battery cells is mainly based on the following methods: using the internal physical and chemical models of the battery to establish mathematical equations to describe the characteristics of the battery, such as the decay law of battery capacity over time; using supervised learning or time series analysis methods to learn the relationship between battery capacity and working conditions from historical data for prediction; or using deep learning methods such as neural networks to learn the complex laws of battery capacity from a large amount of data to achieve high-precision prediction.

[0003] However, the existing iron-lithium battery cell capacity prediction technology still has some defects and shortcomings. For example, when classifying data, the classification effect of a single classification model is not good. In the actual production process, in order to ensure that the predicted battery accuracy meets a certain standard, the battery factory needs to eliminate inaccurate cells. That is, after predicting the cell capacity data, the cells that do not meet the standard need to be eliminated. However, the existing methods all predict the cell capacity data first, and then classify and identify the cell capacity data, which is very easy to have over-killing and missed killing phenomena. Therefore, it is necessary to design a substandard cell identification method that can better balance the missed killing and over-killing phenomena. Summary of the invention

[0004] The main technical problem solved by the present invention is how to further balance the under-killing and over-killing phenomena of battery cells in the actual production process on the basis of improving the prediction accuracy.

[0005] According to the first aspect, some embodiments provide a model training method based on prediction accuracy, comprising:

[0006] Acquire sample data, the sample data including a training set and a prediction set, the training set including a first training subset and a second training subset;

[0007] An interval division condition is set according to a preset error requirement value; according to the interval division condition, the first training subset is interval-divided to obtain initial data intervals; and initial division values ​​are obtained according to the initial data intervals;

[0008] The first training subset is divided according to the initial division value to obtain a divided first training subset, and a plurality of classification models are trained according to the divided first training subset and the second training subset, wherein the training of any one of the classification models according to the divided first training subset and the second training subset includes:

[0009] A current training round obtaining step, obtaining the current training round of the current classification model;

[0010] A training and prediction step, using the first training subset after division to train the current classification model, and predicting the trained classification model in the second training subset to obtain a classification prediction result;

[0011] The parameter calculation step is to obtain the confusion matrix corresponding to the current classification model in the current training round according to the obtained classification prediction results and the actual classification results; obtain the loss value corresponding to the current classification model in the current training round according to the confusion matrix; set the tolerance value corresponding to the current classification model in the current training round according to the current training round and the preset total number of training; obtain the best loss value and loss value record table of the current classification model according to the loss value and tolerance value corresponding to the current classification model in the current training round and the loss value corresponding to the current classification model in the historical training rounds;

[0012] A judgment step, judging whether the classification model after the current training round meets the convergence condition or the termination condition;

[0013] A first continuing training step, if the classification model after the current training round training in the judging step does not meet the convergence condition and the termination condition, then retraining the current analysis model from the current training round obtaining step;

[0014] A second continuing training step, if the classification model after the current training round training in the judgment step does not meet the convergence condition and meets the termination condition, then obtaining a penalty matrix, and obtaining a penalty result matrix according to the penalty matrix and the confusion matrix corresponding to the current classification model in the current training round; obtaining a learning rate, correcting the division value according to the penalty result matrix and the learning rate, using the corrected division value to re-divide the first training subset to obtain a re-divided first training subset, and re-training the current classification model according to the re-divided first training subset and the second training subset;

[0015] A scoring calculation step, if the classification model after the current training round meets the convergence condition in the judgment step, then the scoring value of the current classification model is calculated according to the best loss value of the current classification model and the loss value record table;

[0016] A classification model is selected as the best classification model according to the score values ​​of the various classification models.

[0017] According to the second aspect, some embodiments provide a method for identifying substandard battery cells, including:

[0018] Obtaining the best classification model and the final partition value through the model training method;

[0019] Obtain each data interval according to the final division value;

[0020] The training set and the prediction set are classified using the best classification model to obtain multiple training subsets and prediction subsets, and the prediction model is redundantly trained based on the obtained multiple training subsets and prediction subsets to obtain data prediction results for each data interval;

[0021] According to the data prediction results of each data interval, the data prediction results that need to be eliminated in each data interval are obtained; and the battery cells that do not meet the standards are identified according to the data prediction results that need to be eliminated.

[0022] According to a model training based on prediction accuracy and a method for identifying substandard battery cells according to the above-mentioned embodiment, since the present invention sets interval division conditions based on prediction accuracy, the first training subset is divided into data intervals according to the interval division conditions to obtain an initial division value; then, in the process of training multiple classification models respectively, the initial division value is dynamically adjusted accordingly; the best classification model is obtained according to the score values ​​of each classification model, and the division value corresponding to the best classification model is used as the final division value, thereby obtaining the final data interval; the training set and the prediction set are classified by the best classification model, and then the battery cell capacity is predicted according to the classified training set and prediction set, and the data prediction results that exceed the upper and lower limits of the corresponding data interval are eliminated, thereby ensuring that the prediction accuracy of the final data prediction result can reach a certain standard to avoid missing kills, and the division of the data interval based on the prediction accuracy can divide the training set and the prediction set into smaller data intervals, thereby retaining as many data prediction results as possible, that is, the present embodiment can reduce the over-killing phenomenon on the basis of avoiding missing kills through the division of smaller data intervals, thereby balancing the missing kills and over-killing phenomena of the battery cells in the actual production process. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flowchart of a model training method based on prediction accuracy;

[0024] Figure 2 A flowchart of a method for identifying substandard battery cells;

[0025] Figure 3 Training flowchart for classification model training;

[0026] Figure 4 This is a schematic diagram of data prediction results when the data interval is small;

[0027] Figure 5 This is a schematic diagram of data prediction results when there are many data intervals. DETAILED DESCRIPTION

[0028] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0029] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0030] The serial numbers of the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).

[0031] In an embodiment of the present invention, the inventive concept is that the data prediction results of the expected prediction model of the present invention can fluctuate within a certain error range of the true value, and the classification model will look for corresponding data near the initial partition value during the process of dynamically adjusting the initial partition value. Therefore, if the expected data prediction results can fluctuate within the range of ±1% of the true value, the span of the data interval itself can be set to 1% of the data range, and the corresponding error requirement value is 0.01. This method involves limiting the range of variation of the input features or target variables, thereby introducing a form of constraint in the model training and prediction stages. By dividing the data into smaller intervals, the stability and interpretability of the model can be enhanced, while also helping to reduce the sensitivity of the model to outliers. Therefore, the present invention first sets the interval division condition according to the preset error requirement value, obtains the initial division value according to the interval division condition, and then uses the obtained initial division value to divide the first training subset, and trains multiple classification models according to the divided first training subset to obtain the best classification model. Compared with the traditional classification model, selecting the best classification model from multiple classification models is conducive to improving the adaptability and generalization ability of the classification model, thereby obtaining a better classification effect and a more reliable data prediction result; in this process, the division value is dynamically adjusted by combining multiple factors such as data characteristics, classification results and penalties, and dynamic division of different data intervals is achieved based on the adjusted division value, which can not only solve the problems of feature dependence, high and low mixed values ​​and insufficient accuracy of classification results in traditional classification models, but also effectively balance the under-killing and over-killing of battery cells in the actual production process;

[0032] Among them, overkilling refers to judging that the battery cells that should be qualified are unqualified, which leads to these battery cells being mistakenly eliminated; while missed killing refers to judging unqualified battery cells as qualified, which makes these battery cells with potential problems flow into the market. Therefore, the impact of missed killing is more serious than that of overkilling. In the traditional battery cell capacity prediction, prediction is performed first and then classification is performed. That is, the traditional method is to first obtain the data prediction results, and then judge whether the data prediction results are accurate based on the physical characteristics of the battery cells. For example, a classification model is used to classify the battery cells according to their physical characteristics, and then the unqualified battery cells are eliminated according to the classification results and the data prediction results. However, this elimination process cannot completely avoid missed killing and overkilling. In this embodiment, interval division conditions are set based on the prediction accuracy, and the interval division conditions are set based on the interval division conditions. The optimal classification model is obtained based on the interval division condition to classify the first training subset, and then the training set and the prediction set are classified by the optimal classification model, and then the battery cell capacity is predicted according to the classified training set and the prediction set, and the data prediction results that exceed the upper and lower limits of the corresponding data interval are eliminated, so as to ensure that the prediction accuracy of the final data prediction results can reach a certain standard to avoid missing kills; in addition, the division of data intervals based on prediction accuracy can divide the training set and the prediction set into smaller data intervals, so as to retain as many data prediction results as possible, that is, this embodiment can reduce the over-killing phenomenon on the basis of avoiding missing kills by dividing the data intervals into smaller ones, thereby balancing the missing kills and over-killing phenomena of the battery cells in the actual production process.

[0033] Please refer to Figure 1 In some embodiments, a model training method based on prediction accuracy is disclosed, which includes the following steps:

[0034] Step S100: Acquire sample data, process the sample data, and obtain a first training subset, a second training subset, and a prediction set.

[0035] First, the acquired sample data is cleaned to eliminate missing values ​​and outliers. The sample data collected in this embodiment is the cell capacity data in the production process. Then, feature engineering methods are used to extract features from the sample data to obtain a training set and a prediction set with features. Generally, 70% of all the data with features are used as the training set, and the remaining part is used as the prediction set. Then, the training set is divided into a first training subset and a second training subset in a ratio of 3:7.

[0036] Step S110: setting interval division conditions according to a preset error requirement value, and obtaining an initial division value according to the interval division conditions.

[0037] First, the data in the first training subset are sorted in ascending (or descending) order, and the interval division condition is set according to the preset error requirement value, that is, for any data interval, the interval lower limit and the interval upper limit of the data interval are obtained; the absolute value of the ratio between the interval lower limit and the interval upper limit of the data interval is calculated, and when the difference between 1 and the obtained absolute value is less than the preset error requirement value, it is considered that the interval division condition is met. The interval division condition set in this embodiment can be expressed as:

[0038]

[0039] Among them, α is the preset error requirement value; S t is the upper limit of the tth data interval; Z t It represents the lower limit of the tth data interval; || represents the absolute value sign.

[0040] Then, according to the interval division condition, the first training subset is interval-divided to obtain each initial data interval. The specific process is as follows: assuming that the data interval currently to be obtained is the t-th data interval, the data set consisting of the data that has not been interval-divided in the first training subset is used as the latest first training subset; the minimum value in the latest first training subset is used as the interval lower limit of the t-th data interval currently to be obtained; then, in combination with the interval division condition, the interval upper limit of the t-th data interval currently to be obtained is obtained. Since the interval lower limit of the t-th data interval is fixed at this time, but there will be multiple data that meet the interval division condition in the entire latest first training subset, in order to ensure that each data can be correctly divided into the corresponding data interval, this embodiment selects all data that meet the interval division condition from the latest first training subset, and then takes the maximum value of all the obtained data as the interval upper limit of the t-th data interval currently to be obtained; according to the obtained interval upper limit and interval lower limit, the t-th data interval currently to be obtained is obtained; and so on, each data interval after the first training subset is divided based on the preset error requirement value is called each initial data interval;

[0041] The existing data interval division method is often to extract the division value from the training set by setting the division value to a fixed value or manually setting the ratio of different categories. Since the present invention can dynamically adjust the division value by combining the classification results for penalty when the classification model cannot converge, the classification model will be adjusted near the initial division value during this process. At this time, the higher the prediction accuracy is set, the smaller the data interval will be. In this way, more division values ​​can be obtained to cover the entire data range, and the details in the data can be captured more accurately, which is helpful to improve the reliability of the classification results, so as to further improve the accuracy of the data prediction results.

[0042] According to each initial data interval, an initial partition value is obtained, that is, the upper limit of the interval of the tth data interval currently to be obtained is taken as an initial partition value, and so on, and different partition values ​​obtained thereby are recorded as each initial partition value;

[0043] It should be noted that the upper limit of the last initial data interval in this embodiment participates in obtaining the initial partition value, that is, the upper limit of the last initial data interval is not used as an initial partition value.

[0044] Step S120: training multiple classification models according to the initial segmentation value, the first training subset and the second training subset to obtain a score value of each classification model.

[0045] The number of initial partition values ​​at this time is recorded as N, and the first training subset is partitioned using all the initial partition values, thereby obtaining the first training subset after partitioning. At this time, the N initial partition values ​​will divide the first training subset into N+1 categories, and the category numbers in this embodiment start from 0;

[0046] Then, prepare several classification models, such as SVM (support vector machine), random forest model and multi-layer perceptron model, etc. The number of classification models can be set according to the actual situation. The multiple classification models are trained according to the second training subset and the first training subset after division. The training process of any classification model is as follows Figure 3 As shown, including:

[0047] The current training round acquisition step S121 is to acquire the current training round of the current classification model.

[0048] In the training and prediction step S122, the current classification model is trained using the first training subset after division, and the trained classification model is predicted in the second training subset to obtain a classification prediction result.

[0049] Parameter calculation step S123, obtaining a confusion matrix corresponding to the current classification model in the current training round according to the obtained classification prediction results and the actual classification results; wherein the obtained confusion matrix is ​​a (N+1)*(N+1) matrix, each row in the confusion matrix corresponds to an actual category, each element in the confusion matrix corresponds to a classification result of the current classification model, the elements on the off-diagonal line of the confusion matrix correspond to the misclassification situation, that is, the element values ​​on the off-diagonal line are the proportion of the amount of each misclassified data to all the data, and the elements on the diagonal line of the confusion matrix correspond to the correct situation, that is, the element values ​​on the diagonal line are the proportion of the amount of each correctly classified data to all the data;

[0050] Taking N=2 as an example, if the confusion matrix corresponding to the current classification model in the current training round is:

[0051]

[0052] The first row in the confusion matrix represents the proportion of data that should belong to class 0 to all data, the second row represents the proportion of data that should belong to class 1 to all data, and the third row represents the proportion of data that should belong to class 2 to all data;

[0053] Taking the second row as an example, a total of 40% of the data belongs to the first category, but only 20% of the data is correctly classified, 5% of the data is classified into the 0th category, 15% of the data is classified into the second category, and so on; the row numbers and column numbers of all matrices in this embodiment are numbered from 0, for example, the coordinates of the elements corresponding to the first row and the first column in the matrix are (0, 0), and the coordinates of the elements corresponding to the third row and the third column are (1, 2); that is, the element value with coordinates (1, 2) in the confusion matrix represents the proportion of data that should belong to the first category but is classified as the second category by the current classification model to all data; it can be seen that, for the confusion matrix, the misclassification corresponding to the elements above the diagonal of the confusion matrix is ​​relatively large relative to the actual classification result, and the misclassification corresponding to the elements below the diagonal of the confusion matrix is ​​relatively small relative to the actual classification result;

[0054] It should be noted that, taking the battery cell capacity data as an example, the actual classification results are manually labeled, and the real capacity level is obtained through professional knowledge and experimental measurement. This method relies on the knowledge and experimental equipment of experts. It conducts detailed tests on the battery and combines multiple factors for comprehensive judgment to obtain accurate capacity data and classify it accordingly.

[0055] Calculate the cumulative sum of all elements on the off-diagonal line of the confusion matrix, and use the obtained cumulative sum as the loss value corresponding to the current classification model in the current training round, that is, the cumulative sum of all elements corresponding to the misclassification in the confusion matrix is ​​used as the loss value corresponding to the current classification model in the current training round;

[0056] The tolerance value corresponding to the current classification model in the current training round is set according to the current training round and the preset total number of training: if the current training round is less than 1 / 2 of the preset total number of training, the tolerance value is set to 1.04; if the current training round is greater than or equal to 1 / 2 of the preset total number of training and less than 3 / 4 of the preset total number of training, the tolerance value is set to 1.1; if the current training round is greater than or equal to 3 / 4 of the preset total number of training, the tolerance value is set to 1.16; wherein the preset total number of training in this embodiment can be set according to actual conditions;

[0057] According to the loss value and tolerance value corresponding to the current classification model in the current training round and the loss value corresponding to the current classification model in the historical training round, the relevant parameters of the current classification model are obtained, namely, the best loss value, the best model file, the iteration record table and the loss value record table of the current classification model; wherein, the best loss value refers to the minimum value of all loss values ​​obtained by the current classification model in different training rounds, the best model file refers to the model file corresponding to the best loss value, the iteration record table is used to judge the training status of the current classification model, and the loss value record table is used to record the loss values ​​obtained by the current classification model in different training rounds. The specific process of obtaining the best loss value, the best model file, the iteration record table and the loss value record table of the current classification model is as follows:

[0058] Set the best loss value for the first training to 1. If the loss value of the current classification model in the current training round is less than the best loss value, set the loss value corresponding to the current training round as the best loss value. The model file obtained after the current training round is completed with the best loss value is used as the best model file, and the iteration mark value is recorded as True. Delete all data in the iteration record table and the loss value record table, and then record the current iteration mark value in the iteration record table. At this time, the number of data in the iteration record table is 1, and the data in the loss value record table is 0.

[0059] If the loss value obtained in the current training round is greater than or equal to the optimal loss value and less than the product of the optimal loss value and the tolerance value corresponding to the current training round, the iteration mark value is recorded as True, and the obtained iteration mark value is recorded in the iteration record table; if the loss value obtained in the current training round is greater than the product of the optimal loss value and the tolerance value corresponding to the current training round, the iteration mark value is recorded as False, and the obtained iteration mark value is recorded in the iteration record table; when the number of data in the iteration record table is greater than or equal to 5 and the last 5 are [False, True, False, True, False] or the iteration record is When the number of data recorded in the record table is equal to 10% of the total number of training data and all are False, the entire iteration record table is reset to 5 False, that is, the iteration record table at this time only includes 5 False, and the learning rate is adjusted to 0.9 times the initial value. In this embodiment, the initial value of the learning rate is set to 0.2, and the learning rate is used to correct the division value later; if the number of data recorded in the loss value record table is greater than 10 data and the last 10 consecutive data are the same loss value, the learning rate is increased to 1.1 times the original; wherein, the resetting of the iteration record table is used to prevent repeated triggering operations.

[0060] Determine step S124, determine whether the classification model after training in the current training round meets the convergence condition or the termination condition, wherein the convergence condition refers to: if the number of data recorded in the iteration record table of the classification model after training in the current training round is greater than the preset first reference value, at the end of the iteration record table, the number of data values ​​that are continuously True is equal to the preset first reference value and the variance between the loss values ​​corresponding to each data is less than the product between the preset reference coefficient and the tolerance value, the classification model is considered to be converged; in this embodiment, the preset first reference value is 10, and the preset reference coefficient is 0.0009, that is, if the number of data recorded in the iteration record table is greater than 10, the last 10 iteration mark values ​​are continuously True, and the variance between the loss values ​​obtained by these 10 iteration mark values ​​in the corresponding training rounds is less than the product between 0.0009 and the tolerance value corresponding to the current training round, the classification model is considered to be converged at this time;

[0061] The termination condition refers to the condition that the current classification model has not converged but training needs to be stopped. The termination condition includes two situations. The first situation is that if the current training round is equal to the total training number, the training is stopped; the second situation is that when the current training round is not equal to the total training number, the number of data in the loss value recording table is greater than the preset second reference value and the number of loss values ​​that are the same value in succession is equal to the preset second reference value. The preset second reference value set in this embodiment is 15, that is, if the number of data recorded in the loss value recording table is greater than 15 and the last 15 consecutive data are the same loss value, the training is stopped. At this time, it means that the current classification model is stuck in the local minimum; in addition, when the number of data recorded in the loss value recording table is greater than 10 data and the last 10 consecutive data are the same loss value, the learning rate needs to be increased to 1.1 times the original value. Therefore, in the second case, the learning rate will also be increased five times in succession accordingly.

[0062] The first continuing training step S125, if the classification model after the current training round training does not meet the convergence condition and the termination condition in the judging step, then start from the current training round obtaining step and retrain the current analysis model.

[0063] The second training step S126 is to continue training. If the classification model after the current training round does not meet the convergence condition and meets the termination condition in the judgment step, that is, the current classification model has stopped training but has not converged, the division value needs to be adjusted according to the confusion matrix and learning rate after the current training round. The specific adjustment process is:

[0064] First, a penalty matrix is ​​obtained. The penalty matrix in this embodiment is related to the number of partition values. When the number of partition values ​​is N, the penalty matrix is ​​set to:

[0065]

[0066] Then when N=2, the corresponding penalty matrix is:

[0067]

[0068] The first penalty operation is performed according to the obtained penalty matrix. This penalty is intended to set a corresponding penalty for the degree of misclassification, that is, the greater the classification result, the greater the penalty. Since the elements on the diagonal of the confusion matrix correspond to the correct classification of the current classification model according to the partition value, the farther away from the diagonal, the greater the deviation of the current classification model after the partition value is divided. For example, for data that should belong to class 0, data classified as class 2 will have a greater deviation. Therefore, the penalty for data classified into class 1 is less than that for data classified into class 2. Taking the data with the element value X in the penalty matrix as an example, the first penalty operation is performed on the data:

[0069]

[0070] Among them, Y is the result of the element value X in the penalty matrix after the first penalty operation, and N is the number of partition values.

[0071] Process each element value in the penalty matrix to obtain the classification result matrix. When N=2, the corresponding classification result matrix is:

[0072]

[0073] Then multiply the elements at the same position of the obtained classification result matrix and the confusion matrix to obtain the classification result correction matrix. When N=2, the corresponding classification result correction matrix is:

[0074]

[0075] Taking into account that different amounts of misclassified data should also have different degrees of punishment, that is, if a classification result is misclassified and the corresponding proportion of the classification result is higher, the classification result represented is more deviated from the actual situation, and the required degree of punishment is also greater. Therefore, it is necessary to perform a second penalty operation on the classification result correction matrix. The higher the corresponding element value for the misclassification situation, the higher the degree of punishment that needs to be set. In this embodiment, the square value of each element in the classification result correction matrix is ​​used as the element value at the corresponding position of the final penalty matrix. When N=2, the final penalty matrix obtained can be expressed as:

[0076]

[0077] Multiply the elements at the same position of the confusion matrix and the final penalty matrix. Since each element in the confusion matrix is ​​in the form of the proportion of different classification situations to all data, it is also necessary to compensate each multiplication result by percentage, that is, multiply the elements at the same position of the confusion matrix and the final penalty matrix, and then multiply the obtained multiplication result by 100 to obtain the penalty result matrix. When N = 2, the penalty result matrix is:

[0078]

[0079] Finally, the partition value is corrected according to the penalty result matrix and the learning rate. The specific correction process is: for the Mth partition value, the positive value and the negative value of the partition value are obtained, wherein the positive value of the partition value is the cumulative sum of all elements from (M-1, M) to (M-1, N) in the penalty result matrix; the negative value of the partition value is the opposite of the cumulative sum of all elements from (M, 0) to (M, M-1) in the penalty result matrix; the sum of the positive value and the negative value is multiplied by the learning rate, the product is added to the Mth partition value, and the sum is used as the corrected Mth partition value;

[0080] For example, when N=2, for the initial first division value A, the positive value of the division value is the cumulative sum of all elements with coordinates from (0, 1) to (0, 2) in the confusion matrix, that is, the positive value of the division value is 0.15129+0.43681=0.5881, and the negative value of the division value is the opposite of the cumulative sum of all elements with coordinates from (1, 0) to (1, 0) in the confusion matrix, that is, (-0.01922) is the negative value of the division value. Therefore, the correction result for the first division value is A+(0.5881+(-0.01922))*learning rate, and so on.

[0081] Since the elements above the diagonal of the confusion matrix correspond to the situation that the actual classification results are larger, and the elements below the diagonal of the confusion matrix correspond to the situation that the actual classification results are smaller, take the first partition value when N=2 as an example. According to this partition value, the classification model will divide the data into Class 0 and Class 1. For Class 0, only 10% of the data in the classification results are correctly classified as Class 0, and the rest of the data are more classified into Class 1 and Class 2. In other words, the first partition value is smaller than Class 0. If the first partition value is increased, more data that should belong to Class 0 can be correctly classified into Class 0. Therefore, the situation in the confusion matrix that should belong to Class 0 but is classified into other categories indicates that the first partition value needs to be increased. The value increases in a positive direction, that is, the positive value when adjusting the first partition value is obtained according to the cumulative sum of all elements from (0, 1) to (0, 2); for the first category, 5% of the data that should belong to the first category is divided into the 0th category, that is, for the first category, if the first partition value is reduced, the amount of data that should belong to the first category but is divided into the 0th category can be reduced. Therefore, in the case where the confusion matrix should belong to the first category but is divided into the 0th category, the first partition value needs to be negatively reduced, that is, the opposite number of the cumulative sum of all elements from (1, 0) to (1, 0) is used as the negative value when adjusting the first partition value, and so on; this embodiment adjusts the partition value accordingly through positive and negative values, so as to achieve the best partition balance;

[0082] The first training subset is re-divided using the revised division value to obtain a re-divided first training subset, and the current classification model is re-trained according to the second training subset and the re-divided first training subset.

[0083] In the scoring calculation step S127, if the classification model after the current training round meets the convergence condition in the judgment step, the scoring value of the current classification model is calculated according to the best loss value of the current classification model and the loss value record table; the method for obtaining the scoring value of the current classification model is as follows: the average value of the last preset third reference value loss values ​​in the loss value record table of the current classification model is calculated, and the obtained average value is weightedly summed with the best loss value corresponding to the current classification model, and the obtained weighted summation result is used as the current scoring value of the classification model; wherein, the preset third reference value set in this embodiment is 10, and the reference weights of the obtained average value and the best loss value are both 0.5, that is, the average value of the last 10 loss values ​​in the loss value record table of the current classification model is calculated, and the obtained average value is weightedly summed with the best loss value corresponding to the current classification model, and the obtained weighted summation result is used as the scoring value of the current classification model.

[0084] Step S130: Obtain the best classification model according to the scoring values ​​of each classification model.

[0085] A classification model is selected as the best classification model according to the scoring values ​​of each classification model. In this embodiment, the best model file saved by the classification model with the smallest scoring value is used as the best classification model.

[0086] In this embodiment, the sample data is first cleaned and features are extracted to obtain a first training subset, a second training subset and a prediction set, and interval division conditions are set according to a preset error requirement value. The first training subset is divided into different data intervals according to the interval division conditions to obtain an initial division value, and then the first training subset is divided according to the initial division value to obtain a divided first training subset. The second training subset and the divided first training subset are then used to train multiple classification models. When the classification model cannot converge, a penalty is imposed in combination with the classification result to dynamically adjust the division value. At this time, the corresponding data interval range is also adjusted to solve the problem of feature dependence and mixed high and low values ​​in traditional classification models. Finally, the best classification model is selected according to the scoring values ​​of different classification models to avoid the situation where a single classification model has poor classification effect. Compared with traditional methods, this embodiment has higher flexibility and reliability.

[0087] In some embodiments, a method for identifying substandard battery cells is provided, that is, a prediction model is trained according to the best classification model obtained and a redundant training method, and the substandard battery cells are identified according to the final partition value obtained by the best classification model during the training process and the data prediction results in the corresponding data interval. Please refer to Figure 2 In some embodiments, the method for identifying substandard battery cells includes the following steps:

[0088] Step S200: Obtain the best classification model and the final classification value through a model training method.

[0089] In some embodiments, the model training method mentioned in step S200 can refer to the model training method based on prediction accuracy mentioned above, for example, it obtains the best classification model and the final classification value through steps S100 to S130.

[0090] Step S210: Obtaining various data intervals according to the final division value.

[0091] Since the optimal classification model will adjust the initial segmentation value during the training process, this embodiment first obtains the segmentation value obtained after the optimal classification model is trained as the final segmentation value, wherein the number of the final segmentation values ​​is still N;

[0092] Then the final partition values ​​are sorted. At this time, the sorting method of the final partition values ​​is ascending (or descending), that is, the sorting method of the final partition values ​​is the same as the sorting method of the data in the first training subset;

[0093] Among these final partitioning values, any two adjacent partitioning values ​​constitute a data interval, thus N+1 data intervals can be obtained; among them, for the first partitioning value, the interval less than or equal to the first partitioning value is taken as the first data interval; the interval greater than the first partitioning value and less than or equal to the second partitioning value is taken as the second data interval, and so on; for the last partitioning value, the interval greater than the last partitioning value is taken as the last data interval.

[0094] Step S220: Use the best classification model to divide the entire training set and prediction set to obtain various training subsets and prediction subsets.

[0095] In general, by using the best classification model to divide the entire training set and prediction set, N+1 training subsets and N+1 prediction subsets can be obtained, and the training subsets and prediction subsets are one-to-one corresponding, where the i-th training subset and the i-th prediction subset belong to the same category, and each category corresponds to a data interval.

[0096] Step S230: performing redundant training according to each training subset and prediction subset to obtain data prediction results for each data interval.

[0097] Since the data samples of each training subset and prediction subset obtained after the actual division may be unbalanced, for example, the first training subset contains only 10 sample data, while the first prediction subset contains 30 data, which will lead to the phenomenon of unbalanced training samples; in addition, it is not ruled out that the training subset cannot correspond to the prediction subset one by one due to the lack of classification in the training set. Therefore, this embodiment first selects the training subset according to the prediction subset, that is:

[0098] For any prediction subset, a prediction model is trained using the training subset corresponding to the prediction subset and the training subset adjacent to the training subset, and then the trained prediction model is used to predict the prediction subset. For example, for the i-th prediction subset, when i>1, the prediction model is trained using the i-1-th training subset, the i-th training subset, and the i+1-th training subset, and the trained prediction model is used to predict the i-th prediction subset. By expanding the amount of data in the training subset, the prediction model can be used even when the data classification is poor. Better data prediction results can be obtained; for example, for the second prediction subset, the prediction model is trained using the first, second and third training subsets, and then the trained prediction model is used to predict the second prediction subset; when i=1, the only one adjacent to the first training subset is the second training subset, so for the first prediction subset, the prediction model is trained using the first and second training subsets, and then the good prediction model is used to predict the first prediction subset, and so on; finally, the outputs of all prediction models are used as data prediction results;

[0099] Since this embodiment uses different prediction models to predict different prediction subsets, and each prediction subset corresponds to a category, this embodiment can be understood as using different prediction models on different data intervals to predict corresponding prediction subsets; that is, for any data interval, the data interval will correspond to a prediction model, and the output of the prediction model is the data prediction result corresponding to the data interval.

[0100] It should be noted that, since different training subsets correspond to different categories, for example, for the i-th training subset, the data in the i-1-th training subset is smaller than the data in the i-th training subset, and the data in the i+1-th training subset is larger than the data in the i-th training subset. Therefore, when using adjacent training subsets to train the prediction model, if all the data in the adjacent training subsets are directly used as the data required for the prediction model training, it will cause a certain deviation in the output result of the prediction model. Therefore, this embodiment only selects part of the data in the adjacent training subsets for training, wherein the total number of "partial data" selected from all adjacent training subsets shall not exceed the number of data in the current training subset, and must be "as close to its own classification range as possible"; that is, for the i-th training subset, if there are m data in this training subset, the data selected from the i-1-th training subset is the largest one in the i-1-th training subset. data, among which Indicates the rounding down symbol. The data selected from the i+1th training subset is the smallest in the i+1th training subset. data, if the number of data contained in the i-1th training subset or the i+1th training subset is insufficient At this time, all the data in the i-1th training subset or the i+1th training subset are selected, and so on.

[0101] Step S240: identifying the battery cells that do not meet the standards according to the data prediction results of each data interval.

[0102] After classification by the optimal classification model, the battery cells corresponding to each category have similar physical properties. Therefore, the data prediction results corresponding to each prediction subset should theoretically be the data prediction results corresponding to the battery cells with similar physical properties. If the data prediction results at this time deviate from the true value to a large extent, that is, exceed the fluctuation range relative to the true value expected by the present invention, indicating that there is a large deviation in the data prediction results at this time, then the probability that the battery cells corresponding to the data prediction results are substandard battery cells is relatively high. Therefore, in this embodiment, the data prediction results exceeding the upper and lower limits of the corresponding data interval are recorded as data prediction results that need to be eliminated, that is, for any data interval, the upper and lower limits of the data interval are obtained, and the data prediction results corresponding to the data interval that are less than or equal to the lower limit of the interval or greater than the upper limit of the interval are used as data prediction results that need to be eliminated in the data interval; and since each battery cell actually produced has a corresponding battery cell number, and the data prediction results that need to be eliminated correspond to the battery cell number one-to-one, the battery cells corresponding to the data prediction results that need to be eliminated are substandard battery cells;

[0103] Considering that there may be a phenomenon that some data intervals need to be completely eliminated, if the proportion of data prediction results that need to be eliminated is large, the corresponding amount of data that needs to be eliminated is large, and more data prediction results corresponding to cells that have actually met the standards may be eliminated. At this time, there may be a more serious over-killing phenomenon. Therefore, in order to recover the data of these cells that are mistakenly judged as substandard cells, the preset error requirement value can be adjusted according to the basic adjustment amplitude α, and then the object characteristics of different cells are re-divided more finely, so that the data prediction results corresponding to these cells that are mistakenly judged as substandard cells are more accurate, thereby reducing the over-killing phenomenon. The size of the basic adjustment amplitude can be set according to actual needs. In this embodiment, the basic adjustment amplitude is 0.002;

[0104] Since the overkill phenomenon is more serious, the amount of data prediction results that need to be eliminated is large. In this embodiment, the data prediction results that need to be eliminated are data that exceed the upper and lower limits of the data interval. When the data interval is divided into fewer parts, the corresponding data prediction results are as follows: Figure 4 As shown in , when the data interval is divided into many parts, the corresponding data prediction results are as follows Figure 5 As shown, in Figure 4 and Figure 5In the figure, the horizontal axis represents the sample index of different sample data, the vertical axis represents the cell capacity, "Pre_Cap" represents the predicted cell capacity value, corresponding to the "data prediction result", "True_Cap" represents the actual cell capacity value, corresponding to the "true value", all true values ​​are in Figure 4 and Figure 5 It is shown as a "curve" in the middle;

[0105] Combination Figure 4 and Figure 5 It can be seen that the upper and lower limits of the interval in this embodiment need to be analyzed in the vertical axis direction. For the same size of the interval range, when the data interval is divided finer, the overall amount of data that needs to be eliminated will be reduced, but the data prediction results finally retained in different data intervals will still fluctuate within a certain expected range of the true value, that is, more accurate data prediction results can be obtained through more refined interval division, thereby reducing the over-killing phenomenon; in addition, since the data interval in this embodiment is divided based on the prediction accuracy, when the adjusted data interval becomes more, the corresponding error requirement value will also become smaller, but the corresponding expected prediction accuracy will become higher, which will inevitably meet the expected prediction accuracy before the adjustment. For example, when the prediction accuracy of the data prediction reaches 99.5%, it naturally meets the prediction accuracy standard of 99% prediction accuracy. Therefore, the error requirement value can be adjusted to achieve a more detailed division of the data interval, thereby further reducing the over-killing phenomenon on the basis of ensuring that omissions are avoided;

[0106] It should be noted that whether to adjust the preset error requirement value according to the basic adjustment range can be determined by the proportion of data prediction results to be eliminated;

[0107] That is, in this embodiment, when the preset error requirement value is adjusted according to the basic adjustment amplitude α, assuming that the preset error requirement value is c, the adjusted error requirement value is 1-α times the original value, that is, the adjusted error requirement value can be expressed as c×(1-α); then the data interval is re-divided according to the adjusted error requirement value, and the initial division value is re-obtained, and then the optimal classification model is re-obtained according to the re-obtained initial division value, and the substandard battery cells are re-identified according to the re-obtained optimal classification model.

[0108] This embodiment adds a redundant training module on the basis of the first embodiment. By training the prediction model for adjacent training subsets and then using the trained prediction model to predict a single prediction subset, on the one hand, the data set used for training the prediction model can be expanded, and on the other hand, the utilization rate of edge data can be improved, so that better data prediction results can still be obtained when the data classification is not good; then, based on whether the data prediction results corresponding to different data intervals exceed the upper and lower limits of the interval, the substandard battery cells are identified and eliminated, thereby better balancing the over-killing and under-killing phenomena.

[0109] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0110] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art, according to the concept of the present invention, some simple deductions, modifications or substitutions can be made.

Claims

1. A model training method based on prediction accuracy, characterized in that: include: Acquire sample data, the sample data including a training set and a prediction set, the training set including a first training subset and a second training subset; Set the interval division conditions according to the preset error requirement value; According to the interval division condition, the first training subset is divided into intervals to obtain initial data intervals; Obtaining initial partition values ​​according to each of the initial data intervals; The first training subset is divided according to the initial division value to obtain a divided first training subset, and a plurality of classification models are trained according to the divided first training subset and the second training subset, wherein the training of any one of the classification models according to the divided first training subset and the second training subset includes: A current training round obtaining step, obtaining the current training round of the current classification model; A training and prediction step, using the first training subset after division to train the current classification model, and predicting the trained classification model in the second training subset to obtain a classification prediction result; The parameter calculation step is to obtain the confusion matrix corresponding to the current classification model in the current training round according to the obtained classification prediction results and the actual classification results; obtain the loss value corresponding to the current classification model in the current training round according to the confusion matrix; set the tolerance value corresponding to the current classification model in the current training round according to the current training round and the preset total number of training; obtain the best loss value and loss value record table of the current classification model according to the loss value and tolerance value corresponding to the current classification model in the current training round and the loss value corresponding to the current classification model in the historical training rounds; A judgment step, judging whether the classification model after the current training round meets the convergence condition or the termination condition; A first continuing training step, if the classification model after the current training round training in the judging step does not meet the convergence condition and the termination condition, then retraining the current analysis model from the current training round obtaining step; A second continuing training step, if the classification model after the current training round training in the judgment step does not meet the convergence condition and meets the termination condition, then obtaining a penalty matrix, and obtaining a penalty result matrix according to the penalty matrix and the confusion matrix corresponding to the current classification model in the current training round; obtaining a learning rate, correcting the division value according to the penalty result matrix and the learning rate, using the corrected division value to re-divide the first training subset to obtain a re-divided first training subset, and re-training the current classification model according to the re-divided first training subset and the second training subset; A scoring calculation step, if the classification model after the current training round meets the convergence condition in the judgment step, then the scoring value of the current classification model is calculated according to the best loss value of the current classification model and the loss value record table; A classification model is selected as the best classification model according to the score values ​​of the various classification models.

2. The method according to claim 1, characterized in that The interval division condition is set according to a preset error requirement value, including: for any data interval, obtaining the interval lower limit and the interval upper limit of the any data interval; calculating the absolute value of the ratio between the interval lower limit and the interval upper limit of the any data interval, and when the difference between 1 and the obtained absolute value is less than the preset error requirement value, it is considered that the interval division condition is met.

3. The method according to claim 2, characterized in that The method of obtaining the lower limit and the upper limit of any data interval includes: for the data interval that needs to be obtained currently, taking a data set consisting of data that is not divided into intervals in the first training subset as the latest first training subset; taking the minimum value in the latest first training subset as the lower limit of the data interval that needs to be obtained currently, and obtaining the upper limit of the data interval that needs to be obtained currently according to the interval division condition.

4. The method according to claim 3, characterized in that The method of obtaining the interval upper limit of the data interval currently required to be obtained according to the interval division condition includes: for the data interval currently required to be obtained, selecting all data that meet the interval division condition from the latest first training subset, and taking the maximum value of all the obtained data as the interval upper limit of the data interval currently required to be obtained.

5. The method according to claim 1, characterized in that The obtaining of the initial partition value according to the initial data intervals includes: for any initial data interval, taking the interval upper limit of the any initial data interval as an initial partition value.

6. A method for identifying substandard battery cells, characterized in that: include: Obtaining the best classification model and the final segmentation value through the model training method as described in claims 1 to 5; Obtain each data interval according to the final division value; The training set and the prediction set are classified using the best classification model to obtain multiple training subsets and prediction subsets, and the prediction model is redundantly trained based on the obtained multiple training subsets and prediction subsets to obtain data prediction results for each data interval; According to the data prediction results of each data interval, the data prediction results that need to be eliminated in each data interval are obtained; and the battery cells that do not meet the standards are identified according to the data prediction results that need to be eliminated.

7. The method according to claim 6, characterized in that The obtaining, according to the data prediction results of each data interval, the data prediction results to be eliminated in each data interval includes: For any data interval, obtain the interval upper limit and interval lower limit of the any data interval, and take the data prediction results corresponding to the any data interval that are less than or equal to the interval lower limit or greater than the interval upper limit as the data prediction results that need to be eliminated in the any data interval.

8. The method according to claim 6, characterized in that The identifying of substandard battery cells according to the data prediction results to be eliminated includes: the data prediction results to be eliminated are in one-to-one correspondence with battery cell numbers, and the battery cells corresponding to the data prediction results to be eliminated are the substandard battery cells.

9. A computer-readable storage medium, characterized in that: A computer program is stored on the medium, and the computer program can be executed by a processor to implement the method according to any one of claims 1 to 8.

10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.