A transfer learning method for battery health estimation in small sample recovery
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-06
- Publication Date
- 2026-08-11
AI Technical Summary
部分型号电池会因为市场保有量较少或送检批次太少等工业原因,导致数据量严重不足
[0034]1.本说明书实施例提供的方法及装置,根据目标数据集与训练数据集的空间重叠系数,选取若干与目标域结构最接近的型号对应的训练数据集,用于增强局部结构一致性、降低负迁移风险,学生模型在拟合小样本特有特征时,被锚定在了教师模型划定的合理决策流形内,有效抑制了模型在极少数离群点上的方差膨胀问题,使得训练结果不具备重复性,提高了结论具备稳健性;
Smart Images

Figure CN122549532A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial battery recycling technology, and in particular to a transfer learning method, apparatus, electronic device, and storage medium for estimating the health of recycled batteries in small sample sizes. Background Technology
[0002] In real-world industrial scenarios, different battery models often have different production processes, manufacturing techniques, material ratios, and other industrial conditions. Therefore, for battery model samples with varying industrial conditions, the statistical structure of the features extracted from the original data will differ significantly in high-dimensional space. Statistically, this means that the data for different battery models does not originate from a unified distribution, but rather follows specific sub-distributions based on their respective industrial conditions. If all model samples are directly mixed together to train a unified model, the model would need to simultaneously fit multiple sample distributions from different sources with different local structures under the same set of parameters. This not only increases the learning difficulty but also weakens the model's adaptability to specific models. This mixed distribution may not necessarily preserve the local structure within each model; instead, it may blur the relatively stable category boundaries within their respective domains. Some battery models may have insufficient data due to industrial reasons such as low market share or too few batches submitted for testing. In such cases, training the model using only samples from each model would lead to overfitting and instability due to the limited sample size. In summary, training models under small sample conditions is highly unstable. Instability means that the model is highly sensitive to data perturbation, sample partitioning, random initialization, parameter selection, and even evaluation methods, resulting in a lack of repeatability in training results and a lack of robustness in conclusions. Summary of the Invention
[0003] To address the problems existing in the prior art, this specification describes a transfer learning method, apparatus, electronic device, and storage medium for small sample battery health estimation.
[0004] According to the first aspect, a transfer learning method for small sample battery health estimation is provided. The method includes: obtaining a training dataset corresponding to each battery model, wherein the training dataset includes the number of samples, training samples and real sample labels corresponding to the training samples, determining the basic source domain based on the number of samples, and calculating the spatial folding coefficient between each battery model based on the training dataset corresponding to each battery model.
[0005] Based on the spatial folding coefficient, at least one training dataset corresponding to a battery model is selected as the adaptation source domain. A teacher model is trained based on the adaptation source domain and the basic source domain. Target domain data is obtained and input into the teacher model to obtain soft probabilities.
[0006] An objective function is constructed based on the knowledge distillation loss corresponding to the soft probability and the cross-entropy loss corresponding to the target domain data. A learning model is obtained by training the target domain data based on the objective function. The health of the recycled battery is estimated based on the learning model.
[0007] Preferably, calculating the spatial folding coefficient between the target dataset and the training dataset corresponding to each battery model based on the target dataset includes:
[0008] Using the training datasets corresponding to each battery model as background samples, respectively.
[0009] A first computational sample is selected from the target dataset, and a second computational sample is selected from the background samples based on a preset number of neighbors and the first computational sample. The local inter-class distance is calculated based on the first computational sample and the second computational sample.
[0010] A third computational sample is selected from the target dataset based on a preset number of neighbors, and the intra-class average neighbor distance is calculated based on the first computational sample and the third computational sample.
[0011] The spatial folding coefficient corresponding to the background sample is obtained by comparing the local inter-class distance with the average nearest neighbor distance.
[0012] Preferably, selecting at least one training dataset corresponding to a battery model as the adaptation source domain based on the spatial folding coefficient includes:
[0013] Select the first training dataset corresponding to the smallest spatial folding coefficient as the adaptation source domain;
[0014] If the minimum spatial folding coefficient is greater than a preset first threshold and less than a preset second threshold, then a second training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form an expanded adaptation source domain.
[0015] If the smallest spatial folding coefficient is greater than the second threshold, then a third training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form the expanded adaptation source domain.
[0016] Preferably, the step of selecting a second training dataset based on the spatial folding coefficient and adding it to the adaptation source domain to form the expanded adaptation source domain is as follows:
[0017] The training dataset with the smallest absolute difference between the spatial overlap coefficient and 1 is selected and added to the adaptation source domain.
[0018] Preferably, the method further includes: if the spatial folding coefficients corresponding to each of the training datasets are all greater than a preset third threshold, then the adaptation source domain is not added.
[0019] Preferably, the step of acquiring target domain data and inputting the target domain data into the teacher model to obtain soft probabilities includes:
[0020] The target domain data is input into the teacher model to obtain the teacher model output value;
[0021] The temperature scaling value is obtained by comparing the output value of the teacher model with the preset temperature parameters.
[0022] The temperature scaling value is normalized to obtain the soft probability corresponding to the teacher model.
[0023] Preferably, the knowledge distillation loss is the product of the KL divergence of the soft probabilities corresponding to the teacher model and the soft probabilities corresponding to the student model, and the square of the temperature parameter.
[0024] According to a second aspect, a transfer learning device for small-sample battery health estimation is provided, the device comprising:
[0025] The preprocessing module is used to obtain the training dataset corresponding to each battery model. The training dataset includes the number of samples, training samples, and real sample labels corresponding to the training samples. The number of samples is used to determine the basic source domain, and the spatial folding coefficient between each battery model is calculated based on the training dataset corresponding to each battery model.
[0026] The teacher model training module is used to select at least one training dataset corresponding to a battery model as the adaptation source domain based on the spatial folding coefficient, to train a teacher model based on the adaptation source domain and the basic source domain, to obtain target domain data and input the target domain data into the teacher model to obtain soft probabilities;
[0027] The student model training module is used to construct an objective function based on the knowledge distillation loss corresponding to the soft probability and the cross-entropy loss corresponding to the target domain data, and to train the target domain data based on the objective function to obtain a learning model.
[0028] According to a third aspect, an electronic device is provided, including a processor and a memory;
[0029] The processor is connected to the memory;
[0030] The memory is used to store executable program code;
[0031] The processor runs a program corresponding to the executable program code stored in the memory to perform the steps of the method provided as in the first aspect or any possible implementation thereof.
[0032] According to a fourth aspect, a computer-readable storage medium is provided having a computer program stored thereon, the computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform the method provided as in the first aspect or any possible implementation thereof.
[0033] The beneficial effects of this invention are as follows:
[0034] 1. The method and apparatus provided in the embodiments of this specification select several training datasets corresponding to models that are closest to the target domain structure based on the spatial overlap coefficient between the target dataset and the training dataset. This is used to enhance the consistency of local structure and reduce the risk of negative transfer. When the student model fits the features specific to a small sample, it is anchored within the reasonable decision manifold defined by the teacher model. This effectively suppresses the variance inflation problem of the model at a very small number of outliers, making the training results non-reproducible and improving the robustness of the conclusions.
[0035] 2. The methods and apparatus provided in the embodiments of this specification adapt the source domain to select several training datasets whose structure is closest to that of the target dataset based on the spatial overlap coefficient between the target dataset and the training dataset, in order to enhance local structural consistency and reduce the risk of negative transfer.
[0036] 3. In the methods and apparatus provided in the embodiments of this specification, if the spatial folding coefficients corresponding to each training dataset are all greater than the preset third threshold, no adaptation source domain is added in order to prevent noise caused by the adaptation source domain. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating a transfer learning method for estimating battery health in small sample recycling, as implemented in this specification.
[0039] Figure 2 This is a schematic diagram of the structure of a transfer learning device for small-sample battery health estimation in a specific implementation of this specification;
[0040] Figure 3 This is a schematic diagram of the structure of an electronic device used in a specific implementation of this specification. Detailed Implementation
[0041] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0042] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The following description provides multiple embodiments of this application, which can be substituted or combined with each other. Therefore, this application can also be considered to include all possible combinations of the same and / or different embodiments described. Thus, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then this application should also be considered to include embodiments containing one or more other possible combinations of A, B, C, and D, even if such embodiments are not explicitly described in the following text.
[0043] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this application. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
[0044] See Figure 1 , Figure 1 This is a flowchart illustrating a transfer learning method for small-sample battery health estimation provided in an embodiment of this application. In this embodiment, the method includes:
[0045] S101. Obtain the training dataset and target dataset corresponding to each battery model. The training dataset includes the number of samples, training samples, and real sample labels corresponding to the training samples. The number of samples is used as the basic source domain. The spatial folding coefficient between the target dataset and each battery model is calculated based on the target dataset and the training dataset corresponding to each battery model.
[0046] S102. Based on the spatial folding coefficient, select at least one training dataset corresponding to a battery model as the adaptation source domain, train a teacher model based on the adaptation source domain and the basic source domain, and input the target dataset into the teacher model to obtain soft probabilities.
[0047] S103. Construct an objective function based on the knowledge distillation loss corresponding to the soft probability and the cross-entropy loss corresponding to the target dataset, train the target dataset based on the objective function to obtain a learning model, and perform battery health estimation based on the learning model.
[0048] The entity executing this application may be a cloud server.
[0049] In the embodiments of this specification, training datasets corresponding to various battery models are obtained. The training datasets include the number of samples, training samples, and corresponding real sample labels. Real sample labels include "good battery" and "bad battery." The dataset with the largest number of samples is determined as the base source domain. Spatial folding coefficients between battery models are calculated based on the training datasets corresponding to each model. At least one model's training dataset is selected as the adaptation source domain based on the spatial folding coefficients. The adaptation source domain and the base source domain are merged into a joint source domain. An XGBoost classifier is trained based on the joint source domain as the teacher model. Due to sufficient source domain data, the teacher model can fully learn the general degradation boundary without overfitting due to sample sparsity. A target dataset to be learned is obtained. The target dataset is a dataset with a small number of samples. The target dataset is input into the teacher model to obtain soft probabilities. An objective function is constructed based on the knowledge distillation loss corresponding to the soft probabilities and the cross-entropy loss corresponding to the target dataset. The target dataset is trained based on the objective function to obtain a learning model. The health of recycled batteries is estimated based on the learning model to determine whether the recycled batteries are good or bad. In this application, based on the spatial overlap coefficient between the target dataset and the training dataset, several training datasets corresponding to models that are closest to the target domain structure are selected to enhance the consistency of local structure and reduce the risk of negative transfer. When the student model fits the features specific to a small sample, it is anchored within the reasonable decision manifold defined by the teacher model, which effectively suppresses the variance inflation problem of the model at a very small number of outliers, making the training results non-reproducible and improving the robustness of the conclusions.
[0050] In one possible implementation, calculating the spatial folding coefficient between the target dataset and the training dataset corresponding to each battery model based on the target dataset includes:
[0051] Using the training datasets corresponding to each battery model as background samples, respectively.
[0052] A first computational sample is selected from the target dataset, and a second computational sample is selected from the background samples based on a preset number of neighbors and the first computational sample. The local inter-class distance is calculated based on the first computational sample and the second computational sample.
[0053] A third computational sample is selected from the target dataset based on a preset number of neighbors, and the intra-class average neighbor distance is calculated based on the first computational sample and the third computational sample.
[0054] The spatial folding coefficient corresponding to the background sample is obtained by comparing the local inter-class distance with the average nearest neighbor distance.
[0055] In the embodiments described in this specification, the target dataset is set as The background sample set is denoted as For any sample Given a distance metric and the number of nearest neighbors Under the condition of [condition], first define its average nearest neighbor distance to the background sample, that is, in the background set [condition]. Finding distance Recent There are 1 sample, denoted as _ . Then the local inter-class distance of this sample can be expressed as:
[0056]
[0057] in, This represents the local inter-class distance of the sample. This represents the Euclidean distance between a sample in the target dataset and a sample in the background dataset. A smaller value indicates that there are many background samples spatially close to the sample, suggesting strong inter-class mixing in the local area. A larger value indicates that the sample maintains a large local separation distance from the background samples.
[0058] In the target dataset Finding distance Recent There are 3 similar samples, denoted as And define the average nearest neighbor distance within the class as:
[0059]
[0060] in, This represents the average intra-class nearest neighbor distance of the sample. This represents the Euclidean distance between two samples in the target dataset. This quantity describes the average closeness between the target sample and its internal neighborhood structure. If... A smaller value indicates that the sample is embedded in a relatively compact local cluster of the same type. If... A larger value indicates that the sample is relatively discrete within its class and has weak local compactness.
[0061] By ratioing these two local distances, we obtain the KNN spatial overlap coefficients for the training dataset as background samples:
[0062]
[0063] in, This represents the spatial overlap coefficient. If... A value significantly greater than 1 indicates that the local distance from the sample to the background sample is significantly greater than its local distance to samples of the same class. This means the sample is closer to its own class and farther from the background class, exhibiting better local spatial separation and lower overlap. If... A value close to 1 indicates that the sample's proximity to the background is not significantly different from its intra-class proximity, implying blurred local boundaries and obvious spatial overlap. If... If the result is positive, it means that the background samples near the sample are closer than similar samples. This usually means that the sample is in a region of severe overlap or even locally embedded in the background, and is a potentially difficult-to-classify sample or a sample with abnormal boundaries.
[0064] In one possible implementation, selecting at least one training dataset corresponding to a battery model as the adaptation source domain based on the spatial folding coefficient includes:
[0065] Select the first training dataset corresponding to the smallest spatial folding coefficient as the adaptation source domain;
[0066] If the minimum spatial folding coefficient is greater than a preset first threshold and less than a preset second threshold, then a second training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form an expanded adaptation source domain.
[0067] If the smallest spatial folding coefficient is greater than the second threshold, then a third training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form the expanded adaptation source domain.
[0068] In the embodiments of this specification, as described above, the dataset with the largest number of samples is the base source domain, and the spatial folding coefficient between the target dataset and each training dataset is calculated. The training dataset with the smallest spatial folding coefficient is selected as the adaptation source domain. If the spatial folding coefficient corresponding to the adaptation source domain is greater than a preset first threshold and less than a preset second threshold, an additional training dataset is selected as the adaptation source domain. If the spatial folding coefficient corresponding to the adaptation source domain is greater than the preset second threshold, two additional training datasets are selected as adaptation source domains. For example, the adaptation source domain selection scheme is as follows: the training dataset with the smallest spatial folding coefficient is selected as the adaptation source domain. If this value belongs to the interval [1, 1.2], an additional adaptation source domain is selected; if the value is greater than 1.2, two additional adaptation source domains are selected. In this application, the adaptation source domain selects several training datasets whose structure is closest to the target dataset based on the spatial overlap coefficient between the target dataset and the training dataset, in order to enhance local structural consistency and reduce the risk of negative transfer.
[0069] In one possible implementation, the second training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form an expanded adaptation source domain:
[0070] The training dataset with the smallest absolute difference between the spatial overlap coefficient and 1 is selected and added to the adaptation source domain.
[0071] In the embodiments of this specification, the selection principle for the adaptable source domain is to give preference to those with a spatial overlap coefficient close to 1.
[0072] In one possible implementation, the method further includes:
[0073] If the spatial folding coefficients of the training datasets corresponding to each battery model are all greater than the preset third threshold, then the adaptation source domain will not be added.
[0074] In the embodiments of this specification, if the spatial folding coefficients corresponding to each training dataset are all greater than the preset third threshold, no adaptation source domain is added in order to prevent noise caused by the adaptation source domain.
[0075] In one possible implementation, obtaining target domain data and inputting the target domain data into the teacher model to obtain soft probabilities includes:
[0076] The target domain data is input into the teacher model to obtain the teacher model output value;
[0077] The temperature scaling value is obtained by comparing the output value of the teacher model with the preset temperature parameters.
[0078] The temperature scaling value is normalized to obtain the soft probability.
[0079] In the embodiments of this specification, firstly, the target domain data is input into the teacher model, and forward propagation is performed to obtain the original output value of the last fully connected layer, i.e., the output value of the teacher model. Then, the output value of the teacher model is compared with the preset temperature parameter to obtain the temperature scaling value. The temperature scaling value is normalized to obtain the soft probability.
[0080] Specifically, the soft probability is calculated as follows:
[0081] in, This represents the soft probability corresponding to the teacher model. Representing the teacher model, express The value under the exponential function, Represents target domain data. These are the preset temperature parameters.
[0082] In one possible implementation,
[0083] In the embodiments of this specification, the knowledge distillation loss is
[0084]
[0085] in, For knowledge distillation loss, This represents the soft probability corresponding to the teacher model. This represents the soft probability corresponding to the student model. This represents the teacher model.
[0086] Cross-entropy loss is
[0087]
[0088] in, Represents cross-entropy loss, This represents the student model's original output vector for a given sample. The true label is typically encoded using one-hot encoding. If the true class of the sample is Class 1 (index 0), then the label is [1, 0, 0].
[0089]
[0090] in, Let be the objective function. Represents cross-entropy loss, This is due to knowledge distillation loss.
[0091] The following will be combined with the appendix Figure 2 This paper provides a detailed description of the transfer learning device for small-sample battery health estimation provided in the embodiments of this application. It should be noted that the appendix... Figure 2 The transfer learning apparatus shown is for small-sample battery health estimation and is used to perform the work described in this application. Figure 1 The methods shown in the embodiments are for illustrative purposes only, illustrating the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figure 1 The example shown.
[0092] Please see Figure 2 , Figure 2 This is a schematic diagram of the transfer learning device for small-sample battery health estimation provided in an embodiment of this application. Figure 2 As shown, the device includes:
[0093] Preprocessing module 201 is used to obtain training datasets corresponding to each battery model. The training datasets include the number of samples, training samples, and real sample labels corresponding to the training samples. The number of samples is used to determine the basic source domain, and the spatial folding coefficients between each battery model are calculated based on the training datasets corresponding to each battery model.
[0094] Teacher model training module 202 is used to select at least one training dataset corresponding to a battery model as an adaptation source domain based on the spatial folding coefficient, to train a teacher model based on the adaptation source domain and the basic source domain, to obtain target domain data and input the target domain data into the teacher model to obtain soft probabilities;
[0095] The student model training module 203 is used to construct an objective function based on the knowledge distillation loss corresponding to the soft probability and the cross-entropy loss corresponding to the target domain data, and to train the target domain data based on the objective function to obtain a learning model.
[0096] In one possible implementation, the preprocessing module 201 is specifically used for:
[0097] Using the training datasets corresponding to each battery model as background samples, respectively.
[0098] A first computational sample is selected from the target dataset, and a second computational sample is selected from the background samples based on a preset number of neighbors and the first computational sample. The local inter-class distance is calculated based on the first computational sample and the second computational sample.
[0099] A third computational sample is selected from the target dataset based on a preset number of neighbors, and the intra-class average neighbor distance is calculated based on the first computational sample and the third computational sample.
[0100] The spatial folding coefficient corresponding to the background sample is obtained by comparing the local inter-class distance with the average nearest neighbor distance.
[0101] In one possible implementation, the teacher model training module 202 is specifically used for:
[0102] Select the first training dataset corresponding to the smallest spatial folding coefficient as the adaptation source domain;
[0103] If the minimum spatial folding coefficient is greater than a preset first threshold and less than a preset second threshold, then a second training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form an expanded adaptation source domain.
[0104] If the smallest spatial folding coefficient is greater than the second threshold, then a third training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form the expanded adaptation source domain.
[0105] In one possible implementation, the teacher model training module 202 is specifically used for:
[0106] The training dataset with the smallest absolute difference between the spatial overlap coefficient and 1 is selected and added to the adaptation source domain.
[0107] In one possible implementation, the teacher model training module 202 is specifically used for:
[0108] If the spatial folding coefficients corresponding to each of the training datasets are all greater than a preset third threshold, then the adaptation source domain is not added.
[0109] In one possible implementation, the student model training module 203 is specifically used for:
[0110] The target domain data is input into the teacher model to obtain the teacher model output value;
[0111] The temperature scaling value is obtained by comparing the output value of the teacher model with the preset temperature parameters.
[0112] The temperature scaling value is normalized to obtain the soft probability corresponding to the teacher model.
[0113] In one possible implementation, the student model training module 203 is specifically used for:
[0114] The knowledge distillation loss is the product of the KL divergence of the soft probabilities corresponding to the teacher model and the soft probabilities corresponding to the student model, and the square of the temperature parameter.
[0115] Those skilled in the art will clearly understand that the technical solutions of the embodiments of this application can be implemented by means of software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit (IC), etc.
[0116] Each processing unit and / or module in the embodiments of this application can be implemented by an analog circuit that implements the functions described in the embodiments of this application, or by software that executes the functions described in the embodiments of this application.
[0117] See Figure 3 It shows a schematic diagram of the structure of an electronic device according to an embodiment of this application, which can be used to implement... Figure 1 The method in the illustrated embodiment. (As shown) Figure 3 As shown, the electronic device 300 may include: at least one central processing unit 301, at least one network interface 304, user interface 303, memory 305, and at least one communication bus 302.
[0118] The communication bus 302 is used to enable communication between these components.
[0119] The user interface 303 may include a display screen and a camera. Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0120] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0121] The central processing unit 301 may include one or more processing cores. The central processing unit 301 connects to various parts within the electronic device 300 using various interfaces and lines. It executes various functions of the terminal 300 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling data stored in the memory 305. Optionally, the central processing unit 301 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The central processing unit 301 may integrate one or more of the following: a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the central processing unit 301.
[0122] The memory 305 may include random access memory (RAM) or read-only memory. Optionally, the memory 305 may include a non-transitory computer-readable storage medium. The memory 305 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned central processing unit 301. Figure 3 As shown, the memory 305, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.
[0123] exist Figure 3In the illustrated electronic device 300, the user interface 303 is mainly used to provide an input interface for the user and to acquire user input data; while the central processing unit 301 can be used to call the application program stored in the memory 305 and specifically perform the following operations:
[0124] S101. Obtain the training dataset and target dataset corresponding to each battery model. The training dataset includes the number of samples, training samples, and real sample labels corresponding to the training samples. The number of samples is used as the basic source domain. The spatial folding coefficient between the target dataset and each battery model is calculated based on the target dataset and the training dataset corresponding to each battery model.
[0125] S102. Based on the spatial folding coefficient, select at least one training dataset corresponding to a battery model as the adaptation source domain, train a teacher model based on the adaptation source domain and the basic source domain, and input the target dataset into the teacher model to obtain soft probabilities.
[0126] S103. Construct an objective function based on the knowledge distillation loss corresponding to the soft probability and the cross-entropy loss corresponding to the target dataset, train the target dataset based on the objective function to obtain a learning model, and perform battery health estimation based on the learning model.
[0127] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0128] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0129] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0132] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0133] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0134] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0135] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Those skilled in the art will readily conceive of embodiments of this disclosure upon considering the specification and practicing the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.
Claims
1. A transfer learning method for estimating battery health in small-sample recycling, characterized in that, The method includes: Obtain the training dataset corresponding to each battery model. The training dataset includes the number of samples, training samples, and real sample labels corresponding to the training samples. Determine the basic source domain based on the number of samples. Calculate the spatial folding coefficient between each battery model based on the training dataset corresponding to each battery model. Based on the spatial folding coefficient, at least one training dataset corresponding to a battery model is selected as the adaptation source domain. A teacher model is trained based on the adaptation source domain and the basic source domain. Target domain data is obtained and input into the teacher model to obtain soft probabilities. An objective function is constructed based on the knowledge distillation loss corresponding to the soft probability and the cross-entropy loss corresponding to the target domain data. A learning model is obtained by training the target domain data based on the objective function. The health of the recycled battery is estimated based on the learning model.
2. The transfer learning method for small-sample battery health estimation according to claim 1, characterized in that, The calculation of the spatial folding coefficient between the target dataset and the training dataset corresponding to each battery model based on the target dataset includes: Using the training datasets corresponding to each battery model as background samples, respectively. A first computational sample is selected from the target dataset, and a second computational sample is selected from the background samples based on a preset number of neighbors and the first computational sample. The local inter-class distance is calculated based on the first computational sample and the second computational sample. A third computational sample is selected from the target dataset based on a preset number of neighbors, and the intra-class average neighbor distance is calculated based on the first computational sample and the third computational sample. The spatial folding coefficient corresponding to the background sample is obtained by comparing the local inter-class distance with the average nearest neighbor distance.
3. The transfer learning method for small-sample battery health estimation according to claim 1, characterized in that, The step of selecting at least one training dataset corresponding to a battery model as the adaptation source domain based on the spatial folding coefficient includes: Select the first training dataset corresponding to the smallest spatial folding coefficient as the adaptation source domain; If the minimum spatial folding coefficient is greater than a preset first threshold and less than a preset second threshold, then a second training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form an expanded adaptation source domain. If the smallest spatial folding coefficient is greater than the second threshold, then a third training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form the expanded adaptation source domain.
4. The transfer learning method for small-sample battery health estimation according to claim 3, characterized in that, The second training dataset is selected based on the spatial folding coefficient and added to the adaptation source domain to form the expanded adaptation source domain: The training dataset with the smallest absolute difference between the spatial overlap coefficient and 1 is selected and added to the adaptation source domain.
5. The transfer learning method for small-sample battery health estimation according to claim 3, characterized in that, The method further includes: if the spatial folding coefficients corresponding to each of the training datasets are all greater than a preset third threshold, then the adaptation source domain is not added.
6. The transfer learning method for small-sample battery health estimation according to claim 1, characterized in that, The step of obtaining target domain data and inputting the target domain data into the teacher model to obtain soft probabilities includes: The target domain data is input into the teacher model to obtain the teacher model output value; The temperature scaling value is obtained by comparing the output value of the teacher model with the preset temperature parameters. The temperature scaling value is normalized to obtain the soft probability corresponding to the teacher model.
7. The transfer learning method for small-sample battery health estimation according to claim 6, characterized in that, The knowledge distillation loss is the product of the KL divergence of the soft probabilities corresponding to the teacher model and the soft probabilities corresponding to the student model, and the square of the temperature parameter.
8. A transfer learning device for cost health estimation of recycled batteries with small sample sizes, characterized in that, The apparatus implements the steps of the method as described in any one of claims 1-7, the apparatus comprising: The preprocessing module is used to obtain the training dataset corresponding to each battery model. The training dataset includes the number of samples, training samples, and real sample labels corresponding to the training samples. The number of samples is used to determine the basic source domain, and the spatial folding coefficient between each battery model is calculated based on the training dataset corresponding to each battery model. The teacher model training module is used to select at least one training dataset corresponding to a battery model as the adaptation source domain based on the spatial folding coefficient, to train a teacher model based on the adaptation source domain and the basic source domain, to obtain target domain data and input the target domain data into the teacher model to obtain soft probabilities; The student model training module is used to construct an objective function based on the knowledge distillation loss corresponding to the soft probability and the cross-entropy loss corresponding to the target domain data, and to train the target domain data based on the objective function to obtain a learning model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, the computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform the steps of the method as claimed in any one of claims 1-7.