Metal ion battery electrode specific capacity prediction method based on adversarial transfer learning
By constructing a BatteryDCNN model using adversarial transfer learning, the problem of inaccurate electrode specific capacity prediction was solved, achieving high-precision electrode specific capacity prediction and improving the model's generalization ability and the accuracy of material performance analysis.
Patent Information
- Application Number
- CN202510949404.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies are not effective in predicting the specific capacity of metal-ion battery electrodes. It is difficult to accurately predict the specific capacity of electrode materials through machine learning models, and the feature selection is not reasonable enough, resulting in inaccurate prediction results.
An adversarial transfer learning-based approach was adopted. The BatteryDCNN model was constructed, pre-trained in mutually exclusive subsets, and then the DCNN-TL model was used for feature extraction and fine-tuning. Combined with ensemble learning, the DCNN-ETL model was designed to predict electrode specific capacity.
It achieves high-precision electrode specific capacity prediction on small-scale datasets, improves the model's generalization ability and prediction accuracy, is applicable to the prediction of other material properties, and enhances the effectiveness of material property analysis.
Smart Images

Figure CN120977446A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of electrode specific capacity prediction, and particularly relates to a metal ion battery electrode specific capacity prediction method based on adversarial transfer learning. BACKGROUND
[0002] Metal ion batteries, as a new energy storage technology, have been widely used and attracted attention in various fields due to their high energy density, long cycle life and fast charging and discharging characteristics, such as electric vehicles, portable electronic products such as mobile phones, notebook computers, tablet computers and the like, and are also used in special power sources for aerospace, military and other fields, and power grid energy storage, especially in the field of electric vehicles, metal ion batteries are considered as an important choice for the next generation of energy storage system materials, which can solve the problems of safety and cycle life in traditional electric vehicles. Electrode materials, as a key component of metal ion batteries, their applicability is closely related to many important parameters, such as specific capacity and the like, these indicators are important factors to determine the recyclability, durability and safety of the battery.
[0003] Specific capacity refers to the energy stored per unit volume or mass, and the higher the specific capacity, the more energy the battery can store in the same volume or mass, thereby providing longer use time, and its calculation formula is as follows:
[0004]
[0005] In the formula, n is the number of transferred electrons, F is the Faraday constant, M is the molar mass of the discharge electrode. M
[0006] The specific capacity of traditional battery materials is mostly found by trial and error experiments, which requires a lot of time, effort and resources. Compounds capable of embedding metal ions (such as lithium, sodium, potassium, magnesium, calcium, aluminum) can be used as electrode materials, and the number of such compounds has reached thousands, so it is not the best choice to perform screening analysis through manual experiments. With the development of computational science, using python language to write code program is a promising and convenient computer tool.
[0007] The result accuracy of machine learning depends not only on the selection of the model, but also on the selection of the appropriate features. In previous studies of electrode materials, the selection of features usually only focuses on single component features or structure features, and the model cannot well analyze the contribution of the features to the model. Therefore, it is of great significance to find a best combination from numerous features for accurate prediction of the target performance. Deep neural network (Deep Neural Network, DNN) is an artificial neural network based on multiple layers of neurons. Each layer is composed of multiple neurons, each neuron is connected to the previous layer of neurons, the input layer receives the original data, the model is pre-trained, and the learning is transferred to each model through transfer learning, and then the data is processed layer by layer through the hidden layer, and finally the output layer outputs the prediction result through ensemble learning. In the field of prediction data, it is a widely used learning model with high precision prediction performance and strong application ability. SUMMARY
[0008] The purpose of the present application is to provide a metal ion battery electrode specific capacity prediction method based on adversarial transfer learning, which realizes high-precision online battery specific capacity prediction based on small-scale data sets. The technical scheme adopted is:
[0009] A metal ion battery electrode specific capacity prediction method based on adversarial transfer learning, comprising the following steps:
[0010] Step 1, data collection, including chemical composition, structure parameters and corresponding specific capacity;
[0011] Step 2, data cleaning;
[0012] Step 3, constructing a BatteryDCNN model, which includes 2 DCNN models;
[0013] Step 4, pre-training the corresponding DCNN model based on mutually exclusive subsets;
[0014] Step 5, performing transfer learning on the learning parameters of each pre-trained DCNN model to obtain the corresponding DCNN-TL model;
[0015] Step 6, performing ensemble learning on the data after transfer learning to design a DCNN-ETL model;
[0016] Step 7, training the DCNN-ETL model;
[0017] Step 8, using the trained DCNN-ETL model to predict the specific capacity.
[0018] Preferably, in step 3, the data in step 1 is divided into two mutually exclusive subsets, and one DCNN model is constructed based on one mutually exclusive subset.
[0019] Preferably, in step 5, the DCNN-TL model comprises 1 convolutional layer and 1 fully connected layer.
[0020] Preferably, step 5 specifically comprises the following steps:
[0021] Step 5A, the state dictionary of the pre-trained model (which contains all parameter information of the model) is migrated to the convolutional layer of the DCNN-TL;
[0022] Step 5B, the fully connected layer fine-tunes the data model to obtain the DCNN-TL model;
[0023] Step 5C, features are extracted based on the DCNN-TL model output by step 5B;
[0024] Step 5D, the convolutional neural network judges the probability that the extracted features come from the target domain;
[0025] Step 5E, the model after the above processing is returned for multiple cycles of training, and the DCNN-TL model is obtained.
[0026] Preferably, step 6 specifically comprises: collecting and integrating the data after migration learning, selecting a base learner decision tree, dividing the data set into a training set and a validation set using cross-validation, and independently training each base learner using the training set.
[0027] Compared with the prior art, the application has the following advantages:
[0028] First, the chemical composition, structure parameters and experimental property data of specific capacity of the target battery using different materials to be tested are obtained, and a CSV file containing the chemical composition, structure parameters and specific capacity of all 118 elements in the periodic table is constructed; through data cleaning, a program is designed to clean the data to reduce abnormal value interference and make the model learn better, so that the model can focus more on learning data and rules within a specific range, thereby improving the generalization ability of the model; used for inputting the training set into the DNN machine learning model algorithm to train the model, respectively obtaining an electrode specific capacity prediction model, and evaluating its performance using a test set; used for inputting the sample to be detected into the obtained electrode specific capacity prediction model to predict and compare the specific capacity.
[0029] The application can effectively solve the problem that the existing battery electrode specific capacity prediction effect does not meet the satisfactory degree, has good application prospect, and plays a positive role in promoting the research of battery electrode materials.
[0030] The method has universality, and in the case that a prediction result is poor in a material performance prediction regression problem, feature generation and feature selection can be performed through the idea of the method to improve the accuracy of material performance prediction, and an effective means is provided for material performance analysis of machine learning. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 A schematic flowchart of the metal-ion battery electrode specific capacity prediction based on the adversarial transfer learning;
[0032] Figure 2 A model diagram of BatteryDCNN;
[0033] Figure 3 A flowchart of the adversarial transfer learning of the learning parameters of the pre-trained DCNN model;
[0034] Figure 4 The data is subjected to ensemble learning, the data after the transfer learning is collected and integrated, and data estimation error is performed;
[0035] Figure 5 A model flowchart of inputting the chemical composition, structural parameter data information of different materials to be measured into the DCNN with ensemble learning and transfer learning (DCNN-ETL) model for learning and comparing the error of the original specific capacity data. DETAILED DESCRIPTION
[0036] The metal-ion battery electrode specific capacity prediction method and system based on the adversarial transfer learning will be described in more detail below with reference to the schematic diagram, wherein the preferred embodiments of the present application are represented, and it should be understood that the present application described herein can be modified by those skilled in the art, and the advantageous effects of the present application can still be achieved. Therefore, the following description should be understood as extensive knowledge for those skilled in the art, and not as a limitation on the present application.
[0037] As Figures 1 to 5 The metal-ion battery electrode specific capacity prediction method based on the adversarial transfer learning comprises:
[0038] Step 1, data collection.
[0039] In order to obtain the chemical composition, structural parameters and other data of different materials to be measured, and obtain the experimental property data of the target battery using different materials to be measured, all electrode data in the Material Project (MP) database are downloaded, and a CSV file is constructed, which contains the chemical composition, structural parameters and corresponding specific capacity of all 118 elements in the periodic table of elements.
[0040] The constructed CSV data file is constructed by using the data obtained from experiments by using different material batteries to test, collecting and arranging the data to construct the CSV data file;
[0041] The working ions of the materials in the battery material data instance are mainly potassium (K), calcium (Ca), sodium (Na), magnesium (Mg), aluminum (Al), zinc (Zn), lithium (Li), rubidium (Rb), cesium (Cs), and yttrium (Y),
[0042] The data includes electrochemical performance characteristics, crystal structure characteristics, energy and electronic structure characteristics, and other battery characteristics;
[0043] The composition characteristics include framework formula, working ion, etc.
[0044] The structure characteristics include atomic structure characteristics (StructuralHeterogeneity), charge / discharge energy per atom, and charge / discharge fermi.
[0045] Step 2, data cleaning.
[0046] Through data cleaning, a program is designed to clean the data and reduce the interference of outliers, so that the model learning effect is better, and the model can focus more on learning data and rules within a specific range, thereby improving the generalization ability of the model.
[0047] The main standard of data cleaning is to limit the specific capacity value within the standard deviation range by calculating the average value and standard deviation.
[0048] Step 3, model construction.
[0049] The source data set containing the chemical composition, structure parameters and corresponding specific capacity of all 118 elements in the periodic table is divided into two mutually exclusive subsets, and a BatteryDCNN model is constructed.
[0050] The BatteryDCNN model includes two DCNN models, and the DCNN model corresponds to the mutually exclusive subset.
[0051] The DCNN model is a deep convolutional neural network (DCNN) model for processing battery-related data to predict battery capacity.
[0052] The DCNN model mainly comprises an init used for initializing the structure of each layer of the network and a forward function used for defining the calculation logic of data in the forward propagation process.
[0053] The network structure of each DCNN model comprises, as shown in Figure 2
[0054] The convolutional layer comprises a first convolutional layer, a second convolutional layer and a third convolutional layer connected in sequence.
[0055] A one-dimensional convolutional layer is created in the first convolutional layer. The input channel number is 3, the output channel number is 32, and the kernel size is 3.
[0056] The first ReLU activation function is used for nonlinear transformation of the output after the convolutional operation, and all values less than 0 are changed to 0.
[0057] The pooling layer comprises a first pooling layer, a second pooling layer and a third pooling layer arranged in parallel.
[0058] The pooling kernel size is 2, which performs downsampling on the feature map in the one-dimensional direction, and takes the maximum value in each pooling window (length 2) as the output.
[0059] The flattening operation layer comprises two convolutional layer modules, an activation function and a max pooling layer connected in sequence.
[0060] The input channel numbers of the two convolutional layer modules are the output channel numbers of the previous layer (32 and 64 respectively), and the output channel numbers are increased to 64 and 128 respectively, so as to continuously extract and abstract the features.
[0061] After each convolution, a ReLU activation function and a max pooling layer are followed for nonlinear transformation and downsampling operation.
[0062] The first fully connected layer is used for linear transformation of the input feature dimension, i.e., integrating and converting the features extracted by the previous convolutional layer (flattening operation layer) to a new feature space.
[0063] The second ReLU activation function, i.e., the nn.ReLU() activation function, is used for nonlinear transformation; and the nn.Dropout(0.5) enhances the generalization ability of the model.
[0064] The second fully connected layer and the third fully connected layer connected with the output end of the second fully connected layer first map the output of 512 neurons to 128 neurons, and then finally map the feature dimension to 1 output, outputting the predicted battery capacity value.
[0065] In summary, the forward function first sends the input data x into the previously defined convolutional layer module (convolutional layer, first ReLU activation function, and pooling layer) for a series of convolution, activation, pooling, and other operations to obtain the feature representation after the convolutional layer processing, and then performs a flattening operation on the feature data output by the convolutional layer. After that, the flattened feature data is sent to the fully connected layer module, which undergoes linear transformation, activation, and other operations through multiple fully connected layers to finally obtain the output prediction of the battery capacity value, and then returns the prediction result.
[0066] Step 4, pre-training of the main model.
[0067] The main implementation is to pre-train the deep convolutional neural network (DCNN) model of BatteryDCNN based on the mutual exclusion subset.
[0068] Pre-training covers model instantiation, loss function definition, optimizer and learning rate scheduler settings, as well as the complete process of training the model multiple rounds using the given training data set, and updating the learning rate and printing the current learning rate after each round of training.
[0069] nn.MSELoss (Mean Squared Error Loss Function) is used to define the loss measurement standard during model training.
[0070] The Stochastic Gradient Descent (SGD) optimizer is used to update the model parameters. optim.SGD receives the model parameters to be optimized, while setting the initial learning rate lr = 0.01 and momentum = 0.9 to enable the momentum mechanism.
[0071] A learning rate scheduler StepLR is created, which is used with the previously defined optimizer optimizer to dynamically adjust the learning rate at different stages of the training process.
[0072] The total number of training cycles is set to 50, and then multiple rounds of training are performed through a for loop. In each round of training, the train_model function is called to pass in the current pre-trained model, data loader, loss function, and optimizer to complete the parameter update training operation of the model.
[0073] Then scheduler.step() is called to update the learning rate according to the previously defined learning rate scheduler rules, so that the learning rate is adjusted according to the setting of becoming 0.1 times of the original every 10 cycles.
[0074] Finally, the learning rate in the current optimizer is obtained, and the learning rate is printed for easy viewing of the changes in the learning rate during the training process and monitoring of the training progress.
[0075] Step 5, transfer learning, get advanced DCNN-TL model.
[0076] The learning of each pre-trained DCNN model is used for feature extraction and trainable parameters of model calculation, such as convolution kernel weights, bias in convolution layer, weight matrix, and bias of full connection layer, to conduct transfer learning, and build a DCNN-TL model (DCNN with Transfer Learning) corresponding to the pre-trained DCNN model.
[0077] Features are extracted through the convolution layer and the full connection layer of the DCNN-TL model.
[0078] Each DCNN-TL model contains one convolution layer and one full connection layer.
[0079] One pre-trained DCNN model corresponds to one DCNN-TL model.
[0080] As shown in Figure 3 , the method specifically comprises the following steps:
[0081] Step 5A, migrate the state dictionary of the pre-trained model (which contains all parameter information of the model) to the convolution layer of the DCNN-TL, and then traverse each convolution kernel weight and bias parameter in the convolution layer of the DCNN-TL model, set the requires_grad attribute of each parameter to False, fix the parameters of the convolution layer, and make them not be updated in the subsequent training process.
[0082] Step 5B, the full connection layer performs linear transformation and integration of the feature map data output by the convolution layer by using the weight matrix and bias, to fine-tune the convolution layer features, and get a primary DCNN-TL model.
[0083] An optimizer Adam is used with a small learning rate (such as 1e -3 or 1e -4 ), and a Dropout layer is added after the full connection layer to better fit the new task.
[0084] Step 5C, directly extract the output feature data after forward calculation of the full connection layer by using the primary DCNN-TL model trained based on step 5B.
[0085] Step 5D, the convolutional neural network judges the probability that the features come from the target domain.
[0086] The convolutional neural network accepts the features of the source domain and the target domain in the input layer, and the hidden layer is composed of a linear layer, which performs linear transformation on the input through the weight matrix and the bias term.
[0087] Next, the result of the linear transformation is non-linearly processed using a LeakyReLU activation function.
[0088] The input layer then uses a Sigmoid activation function to compress the output value between 0 and 1, which represents the probability that the input feature comes from the target domain. If the output is close to 1, it means that the discriminator believes that the feature is likely to come from the target domain; if the output is close to 0, it means that the discriminator believes that the feature is likely to come from the source domain.
[0089] The binary cross-entropy loss function is selected to measure the difference between the predicted results of the discriminator and the true labels, and the Adam optimizer is used to update the parameters of the discriminator network.
[0090] Step 5E, the primary DCNN-TL model is trained multiple times in the above-mentioned step cycle, and then a senior DCNN-TL model (a model that makes the last extracted features closer to the target domain) is obtained.
[0091] Step 6, the filtered source domain data after transfer learning is integrated for ensemble learning, and a DCNN-ETL model is designed.
[0092] The DCNN-ETL model includes two senior DCNN-TL models, one fully connected ensemble layer, and one regression layer.
[0093] As shown in Figure 4 , the data after transfer learning is collected and integrated, the base learner decision tree is selected, the data set is divided into training set and validation set by cross-validation, and the training set is used to train each base learner independently;
[0094] The parameters of the base learner are adjusted during the training process. The trained base learner is tested by testing the data attributes, and the results are gradually divided into different branches to finally reach the leaf node to obtain the decision result. The branches that do not meet the attributes are removed to ensure the accuracy of the data.
[0095] The senior DCNN-TL model is trained, and the weighted average method is used to give different weights according to the performance of the base learner and then average the data. The parameters of the new model are adjusted during the process, and the DCNN with ensemble learning and transfer learning (DCNN-ETL) model is obtained.
[0096] Figure 4 The attributes 1-3 data in the table are data in the source domain that are extracted by the DCNN-TL model and meet the attributes of the target domain.
[0097] Step 7, DCNN-ETL model training.
[0098] The chemical composition, structural parameters, and specific capacity data information of different materials to be tested are input into the DCNN-ETL model for training and comparison of original specific capacity data errors.
[0099] Define the function of the training model, which receives the model, training data loader, loss function, optimizer, and number of training rounds as parameters.
[0100] Set the model to evaluation mode, accumulate the sum of mean square error (MSE) and the sum of mean absolute error (MAE) and the sum of mean absolute percentage error (MAPE) on the entire test data set, and count the total number of samples in the entire test data set, initialized to 0.
[0101] The calculation formula of mean square error (MSE) is:
[0102]
[0103] The calculation formula of mean absolute error (MAE) is:
[0104]
[0105] The calculation formula of mean absolute percentage error (MAPE) is:
[0106]
[0107] Loop through the test data provided by the test data loader and send it to the model for forward propagation calculation. Calculate the mean square error (MSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) of the data, and get the number of samples in the current batch by getting the size of the first dimension of the input feature tensor.
[0108] Multiply the mean square error (MSE) of the current batch by the batch size and add it to the total mean square error statistics. Similarly, the mean absolute error (MAE) and the mean absolute percentage error (MAPE) are also processed.
[0109] Finally, the returned data contains the values of the three indicators: mean square error (MSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) calculated on the entire test data set.
[0110] Step 8, use the trained DCNN-ETL model to predict specific capacity.
[0111] A metal ion battery electrode predicted specific capacity system based on adversarial transfer learning, comprising:
[0112] The data generation unit obtains data such as chemical composition and structure parameters of different materials to be tested, and obtains experimental property data about specific capacity of target batteries using different materials to be tested, and constructs a CSV file containing chemical composition, structure parameters and corresponding specific capacity of all 118 elements in the periodic table; through data cleaning, a program is designed to clean the data to reduce abnormal value interference, so that the model can learn better, and the model can focus more on learning data and rules within a specific range, thereby improving the generalization ability of the model;
[0113] The machine learning model training unit is used for inputting the training set into the DNN machine learning model algorithm, adjusting and training the model, obtaining an electrode specific capacity prediction model, and evaluating the performance of the electrode specific capacity prediction model by using the test set.
[0114] The prediction unit is used for inputting a sample to be detected into the obtained electrode specific capacity prediction model, and predicting and comparing the specific capacity.
[0115] The above is only the preferred embodiment of the present application, and does not limit the present application in any way. Any person skilled in the art can make any form of equivalent replacement, modification or change to the technical solutions and technical contents disclosed in the present application without departing from the scope of the technical solutions of the present application, and still belongs to the protection scope of the present application.
Claims
1.A method for predicting specific capacity of metal-ion battery electrode based on adversarial transfer learning, characterized in that, The method comprises the following steps: Step 1, data collection, including chemical composition, structure parameters and corresponding specific capacity; Step 2, data cleaning; Step 3, constructing a BatteryDCNN model, which comprises two DCNN models; Step 4, pre-training the corresponding DCNN model based on mutually exclusive subsets; Step 5, performing transfer learning on the learning parameters of each pre-trained DCNN model to obtain a corresponding DCNN-TL model; Step 6, performing ensemble learning on the data after transfer learning to design a DCNN-ETL model; Step 7, training the DCNN-ETL model; Step 8, using the trained DCNN-ETL model to predict the specific capacity. 2.The metal-ion battery electrode specific capacity prediction method based on adversarial transfer learning according to claim 1, wherein, In step 3, the data in step 1 is divided into two mutually exclusive subsets, and one DCNN model is constructed based on one mutually exclusive subset. 3.The metal-ion battery electrode specific capacity prediction method based on adversarial transfer learning of claim 1, wherein, In step 5, the DCNN-TL model comprises one convolutional layer and one fully connected layer. 4.The metal-ion battery electrode specific capacity prediction method based on adversarial transfer learning of claim 3, wherein, Step 5 specifically comprises the following steps: Step 5A, the state dictionary of the pre-trained model (which contains all parameter information of the model) is migrated to the convolutional layer of the DCNN-TL; Step 5B, the fully connected layer fine-tunes the data model to obtain the DCNN-TL model; Step 5C, extracting features based on the DCNN-TL model output in step 5B; Step 5D, the convolutional neural network judges the probability that the extracted features come from the target domain; Step 5E, returning the model after the above processing for multiple cycles of training to obtain the DCNN-TL model. 5.The metal-ion battery electrode specific capacity prediction method based on adversarial transfer learning of claim 1, wherein, Step 6 specifically comprises: collecting and integrating the data after transfer learning, selecting a base learner decision tree, dividing the data set into a training set and a validation set using cross-validation, and independently training each base learner using the training set.