Training data division and substandard battery cell elimination method for model training
By using the training data division method of data interval density value and weight constraint condition adjustment in battery cell production, the problems of low prediction accuracy of battery cell and overkill and leak-killing phenomena are solved, and higher production quality and efficiency are achieved.
Patent Information
- Application Number
- CN202411550967.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-03-18
AI Technical Summary
In the battery cell production process, existing methods are difficult to ensure prediction accuracy, resulting in overkill and missed killing, affecting production efficiency and product quality.
A training data division method for model training is adopted. By obtaining the sample data of the battery cell capacity data, the sample proportion and division value of the data interval are adjusted according to the density value and weight constraints of the data interval to optimize the training and prediction of the classification model.
The prediction accuracy of the battery cell is improved, overkill and leakage are balanced, and the quality and efficiency of battery cell production are improved.
Smart Images

Figure CN119646504A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of battery cell production, and in particular to a method for dividing training data for model training and removing substandard battery cells. Background Art
[0002] In the field of battery cell production, lithium iron batteries are widely used in electric vehicles, energy storage systems, electric bicycles, etc. due to their high energy density, long life and low self-discharge rate. However, with the continuous growth of market demand and the continuous advancement of technology, improving production efficiency and product quality has become an important challenge facing battery manufacturers.
[0003] In this process, over-killing and omission have become important factors affecting production efficiency and product quality. Over-killing refers to the mistaken identification of qualified battery cells as unqualified and their elimination, resulting in increased production costs and waste of resources; while omission refers to the failure to identify unqualified battery cells, allowing them to flow into subsequent production links, which will have a serious impact on the performance and safety of the battery.
[0004] Existing methods often make predictions first and then classify and identify the cells according to their physical properties. However, the single classification model used in this method has poor classification effects, which makes it difficult for existing methods to ensure prediction accuracy. In addition, existing methods ignore the fact that the actual capacity values of cells produced are also different, which inevitably leads to more over- and under-classification phenomena.
[0005] Therefore, designing a method that can not only ensure that the prediction accuracy of the battery cell reaches the specified standard during actual production, but also better balance the over-killing and under-killing phenomena is of great significance to improving the quality and efficiency of battery cell production. Summary of the invention
[0006] The main technical problem solved by the present invention is how to ensure that the prediction accuracy reaches the specified standard and better balance the over-killing and under-killing phenomena.
[0007] According to the first aspect, an embodiment provides a method for dividing training data for model training, including:
[0008] Acquire sample data for representing cell capacity data, wherein the sample data includes a training set, and the training set includes a first training subset;
[0009] Obtaining each data interval of the first training subset according to the maximum sample value and the minimum sample value of the first training subset;
[0010] Obtaining density values of each data interval;
[0011] The weight value of each data interval is obtained according to the density value of each data interval;
[0012] The weight value of each data interval is adjusted according to the weight constraint condition to obtain the sample ratio of each data interval;
[0013] Each division value is obtained according to the sample ratio of each data interval;
[0014] The training data of the first training subset is divided according to each division value.
[0015] In some embodiments, the data intervals of the first training subset are obtained based on the maximum sample value and the minimum sample value of the first training subset, including: obtaining the sample distribution range of the first training subset based on the maximum sample value and the minimum sample value, dividing the sample distribution range of the first training subset according to a preset number of intervals, and using the obtained division results as the data intervals of the first training subset.
[0016] In some embodiments, obtaining the weight value of each data interval according to the density value of each data interval includes: for any data interval, adjusting the density value of each data interval according to a preset density adjustment parameter, and obtaining the weight value of any data interval according to the obtained adjustment result.
[0017] In some embodiments, the weight value of each data interval is adjusted according to the weight constraint condition to obtain the sample ratio of each data interval, including:
[0018] The weight constraint condition includes a first constraint condition, a second constraint condition and a third constraint condition; wherein, for any data interval, if the weight value of any data interval is greater than a preset maximum weight value, it is considered that the any data interval satisfies the first constraint condition, and the weight value of any data interval is redistributed to complete the first update of the weight value of each data interval;
[0019] If the weight value of any data interval after the first update is greater than a preset multiple of the preset minimum weight value, it is considered that any data interval meets the second constraint condition, and the weight value of any data interval is reduced to complete the second update of the weight value of each data interval;
[0020] If the weight value of any data interval after the second update is less than the preset minimum weight value, it is considered that any data interval meets the third constraint condition, and the weight value of any data interval is numerically padded to complete the third update of the weight value of each data interval;
[0021] The weight value of each data interval after the third update is used as the sample ratio of each data interval.
[0022] In some embodiments, obtaining each division value according to the sample ratio of each data interval includes:
[0023] The total number of value types included in the first training subset is obtained, and each partition value is obtained according to the sample ratio of each data interval and the total number of value types.
[0024] According to the second aspect, an embodiment provides a model training method based on numerical distribution, including:
[0025] Acquire sample data for representing cell capacity data, wherein the sample data includes a training set, and the training set includes a first training subset and a second training subset;
[0026] Processing the first training subset by a training data partitioning method for model training to obtain each partitioning value of the first training subset and use it as an initial partitioning value;
[0027] 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:
[0028] A current training round obtaining step, obtaining the current training round of the current classification model;
[0029] 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;
[0030] 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;
[0031] A judgment step, judging whether the classification model after the current training round meets the convergence condition or the termination condition;
[0032] 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;
[0033] 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;
[0034] 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;
[0035] A classification model is selected as the best classification model according to the score values of the various classification models.
[0036] According to the third aspect, an embodiment provides a method for removing substandard battery cells, including:
[0037] The best classification model and the final partition value are obtained through the model training method;
[0038] According to the final division value, the upper and lower limits of each data interval are obtained;
[0039] Acquire sample data for representing cell capacity data, wherein the sample data includes a training set and a prediction set;
[0040] Using the best classification model to classify the training set and the prediction set to obtain multiple training subsets and prediction subsets, performing redundant training on the prediction model based on the obtained multiple training subsets and prediction subsets to obtain data prediction results for each data interval;
[0041] The upper and lower limits of each data interval are obtained according to the upper and lower limits of each data interval, and the cells that do not meet the standards are eliminated according to the data prediction results of each data interval, the upper and lower limits of elimination.
[0042] In some embodiments, obtaining the upper and lower limits of elimination of each data interval according to the upper and lower limits of each data interval includes:
[0043] For any data interval, obtain the preset comparison value;
[0044] If the arbitrary data interval is the first data interval, the result of multiplying the difference between 1 and the preset comparison value and the interval upper limit of the arbitrary data interval is used as the elimination lower limit of the arbitrary data interval, and the interval upper limit of the arbitrary data interval is the elimination upper limit;
[0045] If the arbitrary data interval is the last data interval, the result of multiplying the sum of 1 and the preset comparison value by the interval lower limit of the arbitrary data interval is used as the elimination upper limit of the arbitrary data interval. At this time, the interval lower limit of the arbitrary data interval is the elimination lower limit;
[0046] If any of the data intervals is neither the first data interval nor the last data interval, calculate the difference between the interval upper limit and the interval lower limit of any of the data intervals, obtain the ratio between the obtained difference and the interval lower limit of any of the data intervals, calculate the difference between the obtained ratio and the preset comparison value, and use 1 / 2 times the difference as the adjustment amount; then multiply the difference between 1 and the adjustment amount by the interval upper limit of any of the data intervals, and use the multiplication result as the elimination upper limit of any of the data intervals; multiply the sum of 1 and the adjustment amount by the interval lower limit of any of the data intervals, and use the multiplication result as the elimination lower limit of any of the data intervals.
[0047] In some embodiments, the step of eliminating the substandard cells according to the data prediction results of each data interval, the elimination upper limit, and the elimination lower limit includes:
[0048] The data prediction results that exceed the upper and lower limits of elimination in the data prediction results of each data interval are taken as the data prediction results that need to be eliminated, and the battery cells that do not meet the standards are eliminated according to the data prediction results that need to be eliminated.
[0049] According to a method for dividing training data and eliminating substandard cells for model training in the above-mentioned embodiment, firstly, by adjusting the density value of each data interval in the first training subset by the density adjustment parameter, the classification model can be made more sensitive to the change of the numerical distribution when the training set and the prediction set are subsequently classified, so that the classification model is more inclined to divide the parts with relatively large changes in numerical distribution into more refined categories; then, the weight value of each data interval is adjusted according to the weight constraint condition to obtain the sample ratio of each data interval, while making the sample ratio of each data interval within the set range, balancing the extreme value differences between the corresponding sample ratios of different data intervals; each division value is obtained according to the sample ratio of each data interval, so that when the data is predicted later The obtained data prediction results are closer to the true values; the obtained partition values are used as the initial partition values to obtain the best classification model and the final partition values, thereby solving the problems of feature dependence, mixed high and low values, and poor classification effect of a single classification model in traditional classification models; finally, the training set and the prediction set are classified by the best classification model to obtain various training subsets and prediction subsets, and then the data prediction results of each data interval are obtained; then, based on the prediction accuracy, the upper and lower limits of the intervals of different data intervals are adjusted to obtain the corresponding upper and lower limits for elimination, thereby re-determining the elimination range, so as to further eliminate substandard cells and retain qualified cells as much as possible, thereby better balancing the over-killing and under-killing phenomena on the basis of ensuring prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A method flow chart of a method for dividing training data for model training;
[0051] Figure 2 A method flow chart of a model training method based on numerical distribution;
[0052] Figure 3 A method flow chart of a method for removing substandard battery cells;
[0053] Figure 4 This is the training flow chart of the classification model;
[0054] Figure 5 This is a schematic diagram of the training data division result when the number of preset intervals is 9;
[0055] Figure 6 This is a schematic diagram of the training data division results when the number of preset intervals is 13. DETAILED DESCRIPTION
[0056] 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.
[0057] 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.
[0058] 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).
[0059] In an embodiment of the present invention, the inventive concept is that the data prediction result of the expected prediction model of the present invention can be closer to the true value, and the capacity value corresponding to the battery cell actually produced is not a fixed value, but fluctuates around the corresponding capacity value of the battery cell to be produced. For example, a battery with a battery cell capacity of 108Ah needs to be produced, but the actual battery cell capacity is within the range of 106Ah to 110Ah and satisfies the normal distribution of qualified products; the existing method often divides the data before predicting the battery cell capacity, such as evenly dividing it into different categories or artificially setting the proportion of different categories, and then predicting the battery cell capacity, and then combining the physical properties of the battery cell to further determine whether the prediction result is accurate, however, the capacity value of the battery cell actually produced itself is different, and there will also be differences within the different categories obtained; for example, the farther away from the mean of the normal distribution, the greater the change range of the internal data of the category, and the closer to the mean of the normal distribution, the gentler the change range of the internal data. If the same processing method is used to process different categories with differences, it will inevitably increase overkill and underestimation. Killing phenomenon, therefore, the present invention first sets the sample ratio of different data intervals according to the degree of data change within different data intervals, so as to obtain an initial partition value; then uses the obtained initial partition value to divide the first training subset, and trains multiple classification models according to the divided first training subset, and then obtains 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 initial partition value is extracted in combination with the degree of data change in different data intervals, and then the partition value is dynamically adjusted in combination with multiple factors such as data characteristics, classification results and penalties, and the dynamic partitioning of different data intervals is realized based on the adjusted partition value, which can not only solve the problems of feature dependence, high and low numerical mixing and insufficient accuracy of classification results existing in traditional classification models, but also make the final retained data prediction results more in line with the true value, thereby effectively balancing the phenomenon of missed killing and over-killing of battery cells in the actual production process;
[0060] Please refer to Figure 1 Some embodiments disclose a method for dividing training data for model training, which comprises the following steps:
[0061] Step S100: Acquire sample data for representing cell capacity data to obtain a first training subset.
[0062] First, the sample data obtained to represent the battery cell capacity data is cleaned to remove missing values and outliers. Feature engineering methods are then 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 rest are used as the prediction set. Then, 30% of the data in the training set is used as the first training subset.
[0063] Step S110: obtaining each data interval of the first training subset according to the maximum sample value and the minimum sample value of the first training subset.
[0064] First, the data in the first training subset are sorted in ascending (or descending) order, and then the maximum sample value and the minimum sample value in the first training subset are obtained. The sample distribution range of the first training subset is obtained according to the obtained maximum sample value and the minimum sample value, and the sample distribution range of the first training subset is divided according to a preset number of intervals. Exemplarily, the first training subset can be divided evenly, and the number of intervals obtained is equal to the preset number of intervals, wherein the preset number of intervals can be set according to demand, and then the obtained division results are used as the data intervals of the first training subset. It should be noted that the order of these data intervals is the same as the sorting method of the data in the first training subset.
[0065] Step S120: Obtain the density value of each data interval, and then obtain the weight value of each data interval.
[0066] First, the density value of each data interval is obtained. In this embodiment, the method used to obtain the density value is Gaussian kernel density estimation. In the field of machine learning and data analysis, kernel density estimation (KDE) is an important non-parametric statistical method used to estimate an unknown probability density function. The basic idea of kernel density estimation is to regard each sample point as a center and use a kernel function (usually a symmetric probability density function) to measure the contribution of the sample point to other points. The closer the point is to the sample point, the greater the corresponding contribution is, and the farther the point is from the sample point, the smaller the corresponding contribution is. That is, if the data in a data interval is more concentrated, the corresponding density value of the data interval is larger, and vice versa, the density value of the data interval is smaller. Therefore, the intensity of data changes in each data interval can be reflected according to the density value of each data interval. In this embodiment, the density value of the corresponding data interval is calculated by the median of all data in each data interval, that is, the result of superposition of the contributions of other sample points in each data interval to the median data is used as the density value of the data interval, thereby obtaining the density value of each data interval;
[0067] Then, for any data interval, the density value of each data interval is adjusted according to the preset density adjustment parameter, and then the weight value of the data interval is obtained according to the obtained adjustment result; in this embodiment, the preset density adjustment parameter is 0.5, and the value can be set according to the actual situation. A power function is constructed according to the preset density adjustment parameter to adjust the density value of each data interval, wherein the preset density adjustment parameter is used as the exponent and the density value of each data interval is used as the base, thereby obtaining the density adjustment result of each data interval; in this embodiment, by adjusting the density adjustment parameter for each data interval, the subsequent classification model can be used to classify the training set and the prediction set more sensitive to the change of the numerical distribution, so that it is more inclined to classify the part with a larger change in the numerical distribution more finely;
[0068] Finally, the cumulative sum of the density adjustment results corresponding to all data intervals is calculated, and then the ratio between the density adjustment result of each data interval and the obtained cumulative sum is calculated respectively, and the obtained ratio is used as the weight value of the corresponding data interval, thereby obtaining the weight value of each data interval.
[0069] Step S130: adjusting the weight value of each data interval according to the weight constraint condition to obtain the sample ratio of each data interval.
[0070] The weight constraint conditions in this embodiment include a first constraint condition, a second constraint condition and a third constraint condition; wherein, for any data interval, if the weight value of the data interval is greater than the preset maximum weight value, the data interval is considered to satisfy the first constraint condition, and the weight value of the data interval is redistributed, thereby completing the first update of the weight values of each data interval; the preset maximum weight value in this embodiment is 0.9, which can be set according to the situation; at this time, if the weight value of a data interval is greater than the preset maximum weight value, the part of the weight value of the data interval that exceeds the preset maximum weight value is evenly distributed to the t data intervals adjacent to the data interval. In this embodiment, t is set to 4, and the size of t can be set according to the actual situation. Here, the t data intervals adjacent to the data interval refer to the t data intervals closest to the data interval;
[0071] For example, if the weight value of a data interval is 0.95, the part of the weight value of the data interval that exceeds the preset maximum weight value of 0.9 refers to the difference between 0.95 and 0.9, that is, 0.05, and then 0.05 is evenly distributed to the four data intervals adjacent to the data interval. At this time, the weight values of the four data intervals are increased by 0.0125 on the basis of the original ones; and so on, each data interval is processed in turn, thereby completing the first update of the corresponding weight value of each data interval;
[0072] For any data interval, if the weight value of the data interval after the first update is greater than the preset multiple of the preset minimum weight value, it is considered that the data interval meets the second constraint condition. At this time, the weight value of the data interval is reduced and redistributed, thereby completing the second update of the weight values of each data interval, further increasing the sample diversity and balancing the extreme value differences; the preset minimum weight value in this embodiment is 0.01, and the preset multiple k is required to satisfy the condition that the product of the minimum value and the preset multiple k is less than the maximum value. Exemplarily, the preset multiple k can be set to 10; at this time, if the weight value of a data interval after the first update is greater than the preset multiple of the preset minimum weight value, the weight value of the data interval after the first update is subtracted by 2 times the preset minimum weight value, and the subtracted part is evenly distributed to the t data intervals adjacent to the data interval;
[0073] That is, if the weight value of a data interval after the first update is greater than 0.1, then the weight value of the data interval after the first update is directly subtracted by twice 0.01, that is, directly subtracted by 0.02, and then 0.02 is evenly distributed to the four data intervals adjacent to the data interval, and so on, and each data interval is processed in turn, thereby completing the second update of the corresponding weight value of each data interval;
[0074] For any data interval, if the weight value of the data interval after the second update is less than the preset minimum weight value, it is considered that the data interval meets the third constraint condition. At this time, the weight value of the data interval is numerically padded to complete the third update of the weight value of each data interval; at this time, if the weight value of a data interval after the second update is less than the preset minimum weight value, the weight value of the data interval after the second update is increased to the preset minimum weight value, and then all data intervals whose weight values after the second update are greater than k times the preset minimum weight value are obtained, and then t data intervals closest to the data interval are selected from these data intervals, and the part of the weight value of the data interval after the second update that is increased to the preset minimum weight value is uniformly subtracted from these t data intervals;
[0075] That is, if the weight value of a data interval after the second update is less than 0.01, then the weight value of the data interval after the second update is increased to 0.01. At this time, the increase of the data interval is the difference between 0.01 and the weight value of the data interval after the second update. Then, all data intervals whose weight values after the second update are greater than 0.1 are obtained, and then the 4 data intervals closest to the data interval are selected from these data intervals, and the increase of the data interval is evenly subtracted from these 4 data intervals, that is, 1 / 4 of the increase of the data interval is subtracted from each of the 4 data intervals.
[0076] Finally, the weight value of each data interval after the third update is used as the sample ratio of each data interval. This embodiment adjusts the weight value of each data interval according to the weight constraint condition, so that the sample ratio of each data interval is within the set range.
[0077] Step S140: obtaining each division value according to the sample ratio of each data interval, and then performing training data division on the first training subset.
[0078] The total number of numerical types included in the first training subset is obtained, and then each division value is obtained according to the sample ratio of each data interval and the total number of numerical types. In this process, in order to ensure that the cumulative sum of each data interval corresponding to the current ratio is 1, it is also necessary to first normalize the sample ratio of each data interval, that is, calculate the cumulative sum of the sample ratios corresponding to each data interval, and then calculate the ratio between the sample ratio of each data interval and the cumulative sum, and use the obtained ratio as the normalized sample ratio of the corresponding data interval. For the convenience of description, the normalized sample ratio of each data interval is still referred to as the sample ratio of each data interval in this embodiment;
[0079] Then, each partition value is obtained in combination with the total number of numerical types contained in the first training subset. For example, for the u-th data interval, the corresponding partition value is obtained as follows: first, the cumulative sum of the corresponding sample proportions from the 1st data interval to the u-th data interval is calculated, and then the total number of numerical types is multiplied by the obtained cumulative sum. In order to ensure that the obtained multiplication result is an integer, the obtained multiplication result needs to be rounded. Taking the first data interval as an example, assuming that the total number of numerical types contained in the first training subset is 100, if the sample proportion of this data interval is 0.022 at this time, the multiplication result corresponding to this data interval is 100×0.022=2.2, that is, the 2.2th numerical value should be used as a partition value, but because the numerical type is an integer, it is rounded down here, that is, the second numerical value is used as a partition value. At this time, the numerical value less than or equal to the partition value belongs to the first category, and so on. In this way, each partition value is obtained, and the training data of the first training subset is divided according to these partition values.
[0080] The training data division results corresponding to different preset interval numbers in this embodiment are as follows Figure 5 , Figure 6 As shown, Figure 5 Schematic diagram of the training data division results when the number of preset intervals is 9. Figure 6 The diagram of the training data division result corresponding to the preset number of intervals is 13; Figure 5 and Figure 6In the figure, the horizontal axis corresponds to the different types of values in the first training subset, the vertical axis corresponds to the capacity value, and the "curves" are all composed of real values; each "dashed line" corresponds to a partition value, from Figure 5 and Figure 6 It can be seen that the method of this embodiment can be used to obtain more interval divisions in places where the value distribution changes more;
[0081] It should be noted that the sample ratios of different data intervals may also be manually set according to the data changes in the first training subset, but it is necessary to ensure that the cumulative sum of the sample ratios of all manually set data intervals is 1.
[0082] This embodiment first performs an average division according to the first training subset to obtain each data interval, and then obtains the weight value of each data interval according to the density value of each data interval. By adjusting the density value of each data interval by the density adjustment parameter, the classification model can be used to classify the training set and the prediction set in the subsequent classification, so that it is more sensitive to the change of the numerical distribution, and is more inclined to perform more refined category division on the parts with larger changes in numerical distribution; the weight value of each data interval is then adjusted according to the weight constraint condition to obtain the sample ratio of each data interval, while making the sample ratio of each data interval within the set range, balancing the extreme value differences between the corresponding sample ratios of different data intervals; finally, each division value is obtained according to the sample ratio of each data interval, and then the training data of the first training subset is divided, so that the data prediction results obtained subsequently can be more in line with the true value.
[0083] Please refer to Figure 2 Some embodiments disclose a model training method based on numerical distribution, which includes the following steps:
[0084] Step S200: Acquire sample data for representing cell capacity data to obtain a first training subset and a second training subset.
[0085] First, the sample data obtained for representing the cell capacity data is cleaned to eliminate missing values and outliers. In this embodiment, the sample data is the cell capacity data in the production process, which can be the same sample data as the sample data in step S100. Feature engineering methods are then 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 rest are used as the prediction set. Then, 30% of the data in the training set are used as the first training subset, and the rest of the data are used as the second training subset.
[0086] Step S210: Process the first training subset using a training data partitioning method to obtain partition values of the first training subset and use them as initial partition values.
[0087] In some embodiments, the training data partitioning method mentioned in step S210 can refer to the training data partitioning method for model training mentioned above, for example, the various partitioning values obtained through steps S100 to S140 are used as the initial partitioning values in this embodiment.
[0088] Step S220: 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.
[0089] 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;
[0090] 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 4 As shown, including:
[0091] The current training round acquisition step S221 acquires the current training round of the current classification model.
[0092] In the training and prediction step S222, 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.
[0093] Parameter calculation step S223, obtaining 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; 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;
[0094] Taking N=2 as an example, if the confusion matrix corresponding to the current classification model in the current training round is:
[0095]
[0096] 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;
[0097] 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;
[0098] 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.
[0099] 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;
[0100] 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;
[0101] 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:
[0102] 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.
[0103] 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.
[0104] Determine step S224, 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 round 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;
[0105] 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.
[0106] The first continuing training step S225, 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 acquisition step and retrain the current analysis model.
[0107] The second continuing training step S226, if the classification model after the current training round training 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, it is necessary to adjust the partition value according to the confusion matrix and learning rate after the current training round. The specific adjustment process is:
[0108] 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:
[0109]
[0110] Then when N=2, the corresponding penalty matrix is:
[0111]
[0112] 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:
[0113]
[0114] 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.
[0115] Each element value in the penalty matrix is processed to obtain the classification result matrix. When N=2, the corresponding classification result matrix is:
[0116]
[0117] 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:
[0118]
[0119] 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:
[0120]
[0121] 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:
[0122]
[0123] 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;
[0124] 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.
[0125] 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;
[0126] 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.
[0127] In the scoring calculation step S227, 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 scoring value of the current 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.
[0128] Step S230: Obtain the best classification model according to the scoring values of each classification model.
[0129] 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.
[0130] 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. The first training subset is divided according to the numerical distribution in the first training subset to obtain an initial division value, so that the part with drastic data changes is divided more finely. Then, the second training subset and the divided first training subset are used to train multiple classification models. When the classification model cannot converge, a penalty is imposed in combination with the classification result, so as to dynamically adjust the division value. At this time, the corresponding data interval range is also adjusted, so as to solve the problem of feature dependence and high and low mixed values in the traditional classification model. Finally, the best classification model is selected according to the score values of different classification models, so as to avoid the situation where the classification effect of a single classification model is not good. Compared with the traditional method, this embodiment has higher flexibility and reliability. In addition, the data division method based on the numerical distribution can make the data prediction results obtained in the subsequent data prediction more close to the true value, so as to further reduce the over-killing phenomenon on the basis of avoiding missed killing, so as to better balance the over-killing and missed killing phenomena.
[0131] Please refer to Figure 3 In some embodiments, a method for removing substandard battery cells is disclosed, which includes the following steps:
[0132] Step S300: Obtain the best classification model and the final classification value through a model training method.
[0133] In some embodiments, the model training method mentioned in step S300 can refer to the model training method based on numerical distribution mentioned above, for example, it obtains the best classification model and the final classification value through steps S200 to S230.
[0134] Step S310: Obtaining the upper limit and lower limit of each data interval according to the final division value.
[0135] 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;
[0136] 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;
[0137] Among these final partitioning values, any two adjacent partitioning values constitute a data interval, thereby 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, and the first partitioning value is the upper limit of the interval of 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 the first partitioning value and the second partitioning value are respectively the lower limit and the upper limit of the interval of 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, and the last partitioning value is the lower limit of the interval of the last data interval; at this time, the upper limit and / or lower limit of the interval corresponding to each data interval can be obtained according to the partitioning value corresponding to the data interval.
[0138] Step S320: Obtain a training set and a prediction set, and classify the training set and the prediction set using the best classification model to obtain various training subsets and prediction subsets.
[0139] In general, the entire training set and prediction set are divided using the best classification model to obtain N+1 training subsets and N+1 prediction subsets, and the training subsets and the prediction subsets are one-to-one corresponding, wherein the i-th training subset and the i-th prediction subset belong to the same category, and each category corresponds to a data interval; in this embodiment, the sample data included in the training set and the prediction set are the cell capacity data in the production process, which may be the same as or different from the sample data in step S100 and step S200;
[0140] It should be noted that the optimal classification model will learn the physical properties of different categories of battery cells in the corresponding true value range during the training process. Therefore, the various training subsets used in the prediction model training can be said to be the result of the optimal classification model classifying according to the physical properties and true values.
[0141] Step S330: performing redundant training on the prediction model according to each obtained training subset and prediction subset to obtain data prediction results for each data interval.
[0142] 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:
[0143] 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;
[0144] 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.
[0145] 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.
[0146] Step S340: Obtain the upper and lower limits of each data interval according to the upper and lower limits of each data interval, and remove the substandard cells according to the data prediction results of each data interval, the upper and lower limits of removal.
[0147] For any data interval, a preset comparison value key is obtained. The preset comparison value in this embodiment is the prediction accuracy expected by the battery manufacturer. For example, when the battery manufacturer wants to retain the prediction results with a prediction error within 1%, the preset comparison value key is set to 0.01, and then the upper and lower limits of elimination are obtained according to the upper and lower limits of each data interval. The specific process is as follows:
[0148] For any data interval, if the data interval is the first data interval, the result of multiplying the difference between 1 and the preset comparison value and the upper limit of the data interval is used as the elimination lower limit of the data interval. At this time, the upper limit of the data interval is the elimination upper limit;
[0149] If the data interval is the last data interval, the result of multiplying the sum of 1 and the preset comparison value by the interval lower limit of the data interval is used as the elimination upper limit of the data interval. At this time, the interval lower limit of the data interval is the elimination lower limit;
[0150] If the data interval is neither the first data interval nor the last data interval, then calculate the difference between the interval upper limit and the interval lower limit of the data interval, and obtain the ratio Q between the obtained difference and the interval lower limit of the data interval, then Q = (interval upper limit - interval lower limit) / interval lower limit; then, calculate the difference between the obtained ratio Q and the preset comparison value key, and record 1 / 2 times the obtained difference as the adjustment amount L, at this time L = (Q-key) / 2; then multiply the difference between 1 and the adjustment amount by the interval upper limit of the data interval, and use the multiplication result as the elimination upper limit of the data interval; multiply the sum of 1 and the adjustment amount by the interval lower limit of the data interval, and use the multiplication result as the elimination lower limit of the data interval;
[0151] There are three comparison results between the ratio Q obtained by the upper limit of the interval and the lower limit of the interval and the preset comparison value key. The first case is that Q is equal to key, indicating that the data prediction results in the data interval at this time all meet the prediction accuracy expected by the battery manufacturer; the second case is that Q is greater than key, indicating that the data prediction results in the data interval at this time have data prediction results that deviate from the true value and exceed the expected prediction error range. If the data prediction results are eliminated according to the upper limit and lower limit of the data interval, the data prediction results corresponding to the batteries that do not meet the standards will be retained, that is, there is a miss, and the range of the data interval needs to be adjusted. At this time, the corresponding adjustment amount L is greater than 0, and the elimination upper limit obtained is less than the upper limit of the data interval. The elimination lower limit is greater than the interval lower limit of the data interval, and the substandard cells are subsequently eliminated based on the obtained elimination upper limit and elimination lower limit, thereby avoiding missed elimination; the third case is that Q is less than key, indicating that at this time, the data prediction results in the data interval have data prediction results that meet the expected prediction error range but will be eliminated, and the corresponding data prediction results corresponding to the cells that meet the standards are eliminated, that is, there is an overkill phenomenon, and the interval range of the data interval needs to be adjusted. At this time, the corresponding adjustment amount L is less than 0, and the elimination upper limit obtained thereby will be greater than the interval upper limit of the data interval, and the elimination lower limit is less than the interval lower limit of the data interval, so that when the substandard cells are eliminated based on the obtained elimination upper limit and elimination lower limit, the cells that meet the standards can be retained as much as possible, thereby reducing the overkill phenomenon;
[0152] Finally, data prediction results that are greater than the upper limit or less than the lower limit are eliminated from the data prediction results corresponding to each data interval. The battery cells corresponding to these eliminated data prediction results are substandard battery cells.
[0153] In this embodiment, the training set and the prediction set are classified by the optimal classification model to obtain various training subsets and prediction subsets. 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 the prediction accuracy, the interval upper limit and the interval lower limit of different data intervals are adjusted to obtain the corresponding elimination upper limit and elimination lower limit, so as to redefine the elimination range, so as to further eliminate substandard battery cells and retain qualified battery cells as much as possible, so as to better balance the over-killing and under-killing phenomena on the basis of ensuring prediction accuracy.
[0154] 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.
[0155] 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 training data partitioning method for model training, characterized in that: include: Acquire sample data for representing cell capacity data, wherein the sample data includes a training set, and the training set includes a first training subset; Obtaining each data interval of the first training subset according to the maximum sample value and the minimum sample value of the first training subset; Obtaining density values of each data interval; The weight value of each data interval is obtained according to the density value of each data interval; The weight value of each data interval is adjusted according to the weight constraint condition to obtain the sample ratio of each data interval; Each division value is obtained according to the sample ratio of each data interval; The training data of the first training subset is divided according to each division value.
2. The method according to claim 1, characterized in that The method of obtaining each data interval of the first training subset according to the maximum sample value and the minimum sample value of the first training subset includes: obtaining the sample distribution range of the first training subset according to the maximum sample value and the minimum sample value, dividing the sample distribution range of the first training subset according to a preset number of intervals, and using the obtained division results as each data interval of the first training subset.
3. The method according to claim 1, characterized in that The method of obtaining the weight value of each data interval according to the density value of each data interval includes: for any data interval, adjusting the density value of each data interval according to a preset density adjustment parameter, and obtaining the weight value of the any data interval according to the obtained adjustment result.
4. The method according to claim 1, characterized in that The weight value of each data interval is adjusted according to the weight constraint condition to obtain the sample ratio of each data interval, including: The weight constraint condition includes a first constraint condition, a second constraint condition and a third constraint condition; wherein, for any data interval, if the weight value of any data interval is greater than a preset maximum weight value, it is considered that the any data interval satisfies the first constraint condition, and the weight value of any data interval is redistributed to complete the first update of the weight value of each data interval; If the weight value of any data interval after the first update is greater than a preset multiple of the preset minimum weight value, it is considered that any data interval meets the second constraint condition, and the weight value of any data interval is reduced to complete the second update of the weight value of each data interval; If the weight value of any data interval after the second update is less than the preset minimum weight value, it is considered that any data interval meets the third constraint condition, and the weight value of any data interval is numerically padded to complete the third update of the weight value of each data interval; The weight value of each data interval after the third update is used as the sample ratio of each data interval.
5. The method according to claim 1, characterized in that The method of obtaining each division value according to the sample ratio of each data interval includes: The total number of value types included in the first training subset is obtained, and each partition value is obtained according to the sample ratio of each data interval and the total number of value types.
6. A model training method based on numerical distribution, characterized in that: include: Acquire sample data for representing cell capacity data, wherein the sample data includes a training set, and the training set includes a first training subset and a second training subset; Processing the first training subset based on the training data partitioning method for model training according to any one of claims 1 to 5 to obtain each partitioning value of the first training subset and use it as an initial partitioning value; 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.
7. A method for removing 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 claim 6; According to the final division value, the upper and lower limits of each data interval are obtained; Acquire sample data for representing cell capacity data, wherein the sample data includes a training set and a prediction set; Using the best classification model to classify the training set and the prediction set to obtain multiple training subsets and prediction subsets, performing redundant training on the prediction model based on the obtained multiple training subsets and prediction subsets to obtain data prediction results for each data interval; The upper and lower limits of each data interval are obtained according to the upper and lower limits of each data interval, and the cells that do not meet the standards are eliminated according to the data prediction results of each data interval, the upper and lower limits of elimination.
8. The method according to claim 7, characterized in that The step of obtaining the upper and lower limits of elimination of each data interval according to the upper and lower limits of each data interval includes: For any data interval, obtain the preset comparison value; If the arbitrary data interval is the first data interval, the result of multiplying the difference between 1 and the preset comparison value and the interval upper limit of the arbitrary data interval is used as the elimination lower limit of the arbitrary data interval, and the interval upper limit of the arbitrary data interval is the elimination upper limit; If the arbitrary data interval is the last data interval, the result of multiplying the sum of 1 and the preset comparison value by the interval lower limit of the arbitrary data interval is used as the elimination upper limit of the arbitrary data interval. At this time, the interval lower limit of the arbitrary data interval is the elimination lower limit; If any of the data intervals is neither the first data interval nor the last data interval, calculate the difference between the interval upper limit and the interval lower limit of any of the data intervals, obtain the ratio between the obtained difference and the interval lower limit of any of the data intervals, calculate the difference between the obtained ratio and the preset comparison value, and use 1 / 2 times the difference as the adjustment amount; then multiply the difference between 1 and the adjustment amount by the interval upper limit of any of the data intervals, and use the multiplication result as the elimination upper limit of any of the data intervals; multiply the sum of 1 and the adjustment amount by the interval lower limit of any of the data intervals, and use the multiplication result as the elimination lower limit of any of the data intervals.
9. The method according to claim 7, characterized in that The step of eliminating the unqualified cells according to the data prediction results, the elimination upper limit and the elimination lower limit of each data interval includes: The data prediction results that exceed the upper and lower limits of elimination in the data prediction results of each data interval are taken as the data prediction results that need to be eliminated, and the battery cells that do not meet the standards are eliminated according to the data prediction results that need to be eliminated.
10. 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 9.