Swinin-Resnet-based doped two-dimensional nano material magnetism prediction method
By constructing an image database of doped two-dimensional nanomaterials and improving the Resnet model, the Swin-Transformer module was introduced, which solved the problem of low magnetic prediction efficiency of doped two-dimensional nanomaterials in traditional technology, and achieved high-accuracy magnetic prediction and improved Research efficiency and safety.
Patent Information
- Application Number
- CN202411384679.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-31
AI Technical Summary
Traditional technology is inefficient when preparing and testing different types, different layers and different sizes of doped two-dimensional nanomaterials, and has high operating risks for materials with unstable chemical properties, making it difficult to accurately regulate material properties.
The magnetic prediction method of doped two-dimensional nanomaterials based on Swin-Resnet, by constructing an image database of doped two-dimensional nanomaterials, using the improved Swin-Resnet model for deep learning, introducing the Swin-Transformer module, replacing the Bottleneck module in Resnet , perform magnetic prediction.
The accuracy of magnetic prediction of doped two-dimensional nanomaterials has been significantly improved to reach 0.9, providing more efficient tools and methods to explore and predict the magnetic properties of doped two-dimensional nanomaterials, improving research efficiency and reducing operational risks.
Smart Images

Figure CN119228771A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of material data processing technology, and specifically to a magnetic prediction method for doped two-dimensional nanomaterials based on Swin-Resnet. Background Art
[0002] In recent years, with the breakthroughs in the theoretical design and experimental preparation of two-dimensional materials, people have found that when the thickness of layered materials is gradually reduced to the limit, their properties are completely different from those of bulk materials. These two-dimensional nanomaterials exhibit physical and chemical properties that are very different from those of three-dimensional materials. For example, the confinement of electrons in two dimensions is very obvious. Using these unique optical, electrical, and magnetic properties, two-dimensional nanomaterials have been initially applied in the fields of biopharmaceuticals, aerospace, energy storage, chip manufacturing, and quantum computing, and have demonstrated a wide range of applications and research value.
[0003] Doping two-dimensional nanomaterials refers to the introduction of different atoms or molecules through doping technology to change the electronic structure and physical properties of two-dimensional nanomaterials, thereby achieving the regulation of material properties. Compared with other defect engineering technologies, such as material boundaries, line defects, vacancies, adsorption, etc., doping technology can achieve precise regulation of material properties. By selecting specific doping elements, the electronic structure and physical properties of materials, such as conductivity and magnetism, can be precisely adjusted. Secondly, doping technology can be applied to almost all two-dimensional materials, and diversified performance regulation can be achieved by selecting different doping elements. At the same time, doping atoms are usually more firmly embedded in the material lattice, improving the chemical and physical stability of the material. However, due to the complexity of the doping process and the special properties of two-dimensional nanomaterials, traditional material experimental research often faces difficulties and limitations. If you want to prepare and test doped two-dimensional materials of different types, different numbers of layers and different scales, you need to design different schemes. The whole process requires a lot of resources and is inefficient. For two-dimensional materials with unstable chemical properties, manual operation is very likely to cause accidents.
[0004] Magnetism is an important property of doped two-dimensional nanomaterials. In recent years, two-dimensional magnetic materials have attracted widespread attention in the fields of spin electronics, magnetic catalysts, magnetic storage devices, sensors and quantum computing due to their potential application value. In order to deeply understand the magnetic behavior of doped two-dimensional nanomaterials, magnetic prediction research has become an important means. The significance of magnetic prediction research is to predict the magnetic behavior of doped two-dimensional nanomaterials through theoretical simulation and calculation, so as to provide guidance and theoretical basis for experimental research. However, due to the complexity of the doping process, using traditional technology to prepare and test doped two-dimensional materials of different types, different numbers of layers and different scales requires the design of different schemes. The whole process requires a lot of resources and is inefficient. For some two-dimensional materials with unstable chemical properties, manual operation is very likely to cause accidents. Summary of the invention
[0005] In order to solve the problems existing in the prior art, the present invention provides a magnetic prediction method for doped two-dimensional nanomaterials based on Swin-Resnet. An image data set that can be used for deep learning is constructed based on a public database of doped two-dimensional nanomaterials. Then, an improvement study is conducted on the Resnet model, a Swin-Transformer module is introduced, and a Swin-Resnet network structure is proposed. A comparative study is conducted on the magnetic prediction of doped two-dimensional nanomaterials with various deep learning models such as Resnet, Res2net, ResneXt, and Swin-Transformer. The optimized model has achieved significant results in magnetic prediction, with the best Acc reaching 0.9.
[0006] Specifically, the present invention provides a method for predicting the magnetic properties of doped two-dimensional nanomaterials based on Swin-Resnet, comprising: Construct an image database of doped two-dimensional nanomaterials; Selecting an image data set of doped two-dimensional nanomaterials whose main element is As from the image database, and performing data enhancement on the selected image data set; Annotate the enhanced image dataset to identify the magnetic properties corresponding to different doped two-dimensional nanomaterials; The annotated image dataset is used to train the Swin-Resnet model, wherein the Swin-Resnet model uses Resnet50 as the backbone network and replaces the conv 3*3 module in Bottleneck with the SwinT module; The image data of the doped two-dimensional nanomaterial to be predicted is input into the trained Swin-Resnet model to predict the material's magnetic properties.
[0007] As a further illustration of the present invention, the construction of an image database of doped two-dimensional nanomaterials specifically includes: Obtain the latest structural data of doped two-dimensional nanomaterials from the materials database; The acquired structural data of the doped two-dimensional nanomaterials are processed using image processing tools to generate images and construct an image database of the doped two-dimensional nanomaterials.
[0008] As a further illustration of the present invention, the image data set is annotated by extracting magnetic moment data from the material database.
[0009] As a further illustration of the present invention, the data enhancement method includes: horizontal flip enhancement, vertical enhancement, mirror symmetry enhancement, affine change, rotation, Gaussian noise, contrast change, scale conversion and translation.
[0010] As a further illustration of the present invention, the SwinT module uses Reshape to convert the data dimension. At the same time, LayerNorm is moved back and set behind Window Attention, MLP, and ShitWindow Attention, and Conv2D convolution is used to process it into two-dimensional data after the SwinT module is processed.
[0011] As a further illustration of the present invention, during the model training process, the parameters are set as follows: 1000 training rounds, a learning rate of 0.01, SGD, Momentum and RMSProp as optimizers, CrossEntropyLoss as loss function, and batch_size of 64.
[0012] Compared with the prior art, the present invention has the following beneficial technical effects: The present invention constructs an image dataset that can be used for deep learning based on a public database of doped two-dimensional nanomaterials, and improves the Resnet model so that it can better predict the magnetism of doped two-dimensional nanomaterials. The present invention provides better tools and methods to explore and predict the magnetic properties of doped two-dimensional nanomaterials, has great feasibility and application value in predicting the magnetism of doped two-dimensional nanomaterials, and is of great significance to promoting the research on the magnetism of doped two-dimensional nanomaterials.
[0013] Other features and advantages of the technical solution will be described in the subsequent description, and partly become apparent from the description, or understood by implementing the technical solution. The purpose and other advantages of the technical solution can be achieved and obtained through the structures specifically pointed out in the written description and the drawings.
[0014] The technical solution of the present technical solution is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings are used to provide a further understanding of the technical solution and constitute a part of the specification. Together with the embodiments of the technical solution, they are used to explain the technical solution and do not constitute a limitation of the technical solution. In the accompanying drawings: Figure 1: The network structure diagram of Swin-Resnet in the embodiment of the present invention, wherein (a) is the structure diagram of Swin-ResNet50; (b) is the structure diagram of the modified Bottleneck; and (c) is the structure diagram of the SwinT module in Bottleneck.
[0016] Figure 2 This is the image data of the doped two-dimensional nanomaterial in the embodiment of the present invention. DETAILED DESCRIPTION
[0017] The preferred embodiments of the present technical solution are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present technical solution, and are not used to limit the present technical solution.
[0018] The embodiment of the present invention provides a method for predicting the magnetism of doped two-dimensional nanomaterials based on Swin-Resnet, comprising the following steps: S100. Construct an image database of doped two-dimensional nanomaterials.
[0019] The above-mentioned construction of an image database of doped two-dimensional nanomaterials specifically includes: obtaining the latest structural data of doped two-dimensional nanomaterials from a material database; using image processing tools to process the obtained structural data of doped two-dimensional nanomaterials, generate images, and construct an image database of doped two-dimensional nanomaterials.
[0020] Specifically, the data set of the embodiment of the present invention is the latest data of doped two-dimensional nanomaterials obtained from the current public computational material database CMR. Since the downloaded database does not contain image data, this paper uses the image processing tool Jmol to process the corresponding structural data to generate images and construct an image database of doped two-dimensional nanomaterials so that it can be applied to actual experiments. The image data of doped two-dimensional nanomaterials is as follows: Figure 2 shown.
[0021] S200, selecting an image data set of doped two-dimensional nanomaterials whose main element is As from an image database, and performing data enhancement on the selected image data set.
[0022] Specifically, there are about 17,000 doped two-dimensional nanomaterial data in the computational material database. The data set of this embodiment selects the doped two-dimensional nanomaterial data with the main element As for model training, verification and testing. In order to extract more useful information features, the image data used in the experiment is enhanced. The data enhancement methods in this experiment include horizontal flip enhancement, vertical enhancement, mirror symmetry enhancement, affine change, rotation, Gaussian noise, contrast change, scale conversion and translation. The enhanced image data set has a total of 12,760 doped two-dimensional nanomaterial images, each of which is 500*500 pixels in size. The image size will be uniformly reduced to 224*224 during the experiment.
[0023] S300, annotating the enhanced image data set to identify the magnetic properties corresponding to different doped two-dimensional nanomaterials.
[0024] The above datasets also need to be annotated by themselves. In this experiment, the corresponding magnetism of different two-dimensional nanomaterial structures is mainly identified based on their images (the magnetic moment is used to represent the magnetic size of different materials). The image dataset is annotated by extracting the magnetic moment data from the public database.
[0025] S400. Use the annotated image dataset to train the Swin-Resnet model, where the Swin-Resnet model uses Resnet50 as the backbone network and replaces the conv 3*3 module in Bottleneck with the SwinT module.
[0026] The present invention uses Resnet50 as the backbone network to construct a Swin-Resnet network similar to the traditional ResNet structure. The network structure of Swin-Resnet50 is as follows: Figure 1 As shown in (a), the conv 3*3 module in Bottleneck is replaced with the SwinT module to enhance its feature extraction capability. The SwinT module is adjusted on the original Swin-Transformer to adapt it to the Resnet network. Experiments have shown that after using the SwinT module to replace the traditional convolution module, the improved Swin-Resnet has an Acc improvement of 90% compared to the traditional Resnet.
[0027] Among them, the modified Bottleneck is as follows Figure 1 As shown in (b), Bottleneck has the same structure as the traditional ResNet, except that the second convolution is replaced by a SwinT module. Figure 1As shown in (c), although the data input in the traditional Swin-Transformer is also an image, it is processed into one-dimensional data before training. In the traditional Resnet, two-dimensional data is used to facilitate convolution operations. In order to adapt to the training process in ResNet, the present invention uses Reshape to convert the data dimension in the SwinT module. At the same time, LayerNorm is moved back and set behind WA (WindowAttention), MLP, and SWA (ShitWindow Attention), and Conv2D convolution is used to process it into two-dimensional data after the SwinT module is processed.
[0028] The specific parameter configuration of the Swin-Resnet model provided in the embodiment of the present invention is shown in Table 1 below: Table 1 Parameter configuration of the Swin-Resnet model
[0029] In the table, Layer name is the layer name, Layer number is the layer number, Layer Type is the module name of the layer, k is the size of the convolution kernel, s is the step size, and c is the number of channels.
[0030] The embodiment of the present invention trains the proposed Swin-Resnet model based on the above generated data set, and studies the performance of different models in predicting the magnetism of doped two-dimensional nanomaterials by comparing the traditional ResNet model and its related improved models. The experimental results show that the Swin-ResNet model performs better in key performance indicators and is more suitable for predicting the magnetism of doped two-dimensional nanomaterials than other ResNet improved models.
[0031] Table 2 shows the hardware environment facilities of this experiment. The server configuration is CPU: 4 Cores, GPU is Tesla V100, and the deep learning platform used is Baidu PaddlePaddle.
[0032] Table 2 Experimental environment
[0033] In this experiment, the traditional ResNet model and its improved models were selected for comparative training, including ResNet, DenseNet, Res2Net, ResNeXt and the traditional Swin-Transformer model.
[0034] This experiment uses accuracy (ACC) as the main evaluation index to evaluate the performance of the model proposed in this invention. The accuracy (ACC) is calculated using a confusion matrix that records the predictions of a classifier with n categories. The confusion matrix provides detailed information about the performance of the classifier by comparing the predicted categories with the actual categories. The confusion matrix contains elements such as true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN). The accuracy is the ratio of the number of correctly identified samples to the total number of samples, and its calculation formula is shown below.
[0035]
[0036] In addition, this experiment also uses precision, recall and F1-score as indicators to further evaluate model performance. Precision is used to measure the proportion of samples predicted as positive that actually belong to the positive category. The calculation formula for precision is as follows, usually expressed as a percentage, reflecting the accuracy of all positive predictions of the classifier.
[0037]
[0038] Recall is used to measure the proportion of samples that actually belong to the positive category and are correctly identified as positive by the classifier. It evaluates the ability of the classifier to identify all positive samples. The calculation formula of recall is as follows, which represents the proportion of true positive predictions among all actual positive samples. A high recall indicates that the classifier effectively captures most of the positive samples in the dataset.
[0039]
[0040] The F1-Score combines precision and recall to provide a single assessment of the effectiveness of a classifier. It provides a comprehensive assessment by balancing precision (the ability to accurately identify positive samples) and recall (the ability to identify all positive samples). The calculation formula for the F1-Score is shown below and ranges from 0 to 100%. A high F1-Score indicates that the classification method has achieved a good balance between precision and recall. By taking into account both precision and recall, the F1-Score provides a comprehensive assessment of the overall performance of the classifier.
[0041]
[0042] The experimental parameters are set as follows: the number of training epochs is 1000, the learning rate is 0.01, the optimizers are the classic SGD, Momentum and RMSProp, the loss function is CrossEntropyLoss, the batch_size is 64, and the final training results are shown in Table 3.
[0043] Table 3 Magnetic prediction results based on doped two-dimensional nanomaterials
[0044] From the above experimental results, it can be concluded that the Swin-ResNet model proposed in the present invention has certain advantages in the prediction of magnetism based on doped two-dimensional nanomaterials. Specifically, when the SGD optimizer is used, the accuracy (Acc) of the Swin-ResNet proposed in the present invention reaches 0.9, which is significantly higher than other models. The Acc of the traditional ResNet model is 0.82, DenseNet and ResNeXt reach 0.86 and 0.85 respectively, while Res2Net and ResNeXt are only 0.76 and 0.71. At the same time, Swin-ResNet also shows high levels in Precision, Recall and F1-score, which are 0.87, 0.88 and 0.85 respectively.
[0045] When using the Momentum optimizer, the accuracy (Acc) of Swin-ResNet also reached 0.89, which is basically better than other models of the same type. Only DenseNet reached the same level, and other models were around 0.86. When using the RMSProp optimizer, the accuracy (Acc) of Swin-ResNet was 0.87932, which was slightly lower than the performance under the Momentum and SGD optimizers, but still slightly higher than other models. At this time, ResNeXt showed a higher level, while DenseNet was only 0.83.
[0046] In addition, the Swin-Transformer model performed poorly in this experiment, with an Acc of only about 0.4, much lower than other models. This shows that although Swin-Transformer may have advantages in other tasks, its performance in the magnetic prediction task of doped two-dimensional nanomaterials in this paper is not ideal.
[0047] S500, inputting the image data of the doped two-dimensional nanomaterial to be predicted into the trained Swin-Resnet model to predict the magnetic properties of the material.
[0048] In summary, the present invention proposes a method based on deep learning technology for predicting the magnetism of doped two-dimensional nanomaterials. An image dataset that can be used for deep learning is constructed based on a public database of doped two-dimensional nanomaterials, and then an improvement study is conducted on the Resnet model, the Swin-Transformer module is introduced, and the Swin-Resnet network structure is proposed. By comparing the magnetism prediction of doped two-dimensional nanomaterials with a variety of deep learning models such as Resnet, Res2net, ResneXt, and Swin-Transformer, the optimized model has achieved significant results in magnetism prediction, with the best Acc reaching 0.9.
[0049] Obviously, those skilled in the art can make various changes and modifications to the technical solution without departing from the spirit and scope of the technical solution. Thus, if these modifications and variations of the technical solution fall within the scope of the claims of the technical solution and their equivalents, the technical solution is also intended to include these modifications and variations.
Claims
1. A magnetic prediction method for doped two-dimensional nanomaterials based on Swin-Resnet, characterized in that: include: Construct an image database of doped two-dimensional nanomaterials; Selecting an image data set of doped two-dimensional nanomaterials whose main element is As from the image database, and performing data enhancement on the selected image data set; Annotate the enhanced image dataset to identify the magnetic properties corresponding to different doped two-dimensional nanomaterials; The annotated image dataset is used to train the Swin-Resnet model, wherein the Swin-Resnet model uses Resnet50 as the backbone network and replaces the conv 3*3 module in Bottleneck with the SwinT module; The image data of the doped two-dimensional nanomaterial to be predicted is input into the trained Swin-Resnet model to predict the material's magnetic properties.
2. The magnetic prediction method of doped two-dimensional nanomaterials based on Swin-Resnet as claimed in claim 1, characterized in that: The step of constructing an image database of doped two-dimensional nanomaterials specifically includes: Obtain the latest structural data of doped two-dimensional nanomaterials from the materials database; The acquired structural data of the doped two-dimensional nanomaterials are processed using image processing tools to generate images and construct an image database of the doped two-dimensional nanomaterials.
3. The magnetic prediction method of doped two-dimensional nanomaterials based on Swin-Resnet as claimed in claim 2, characterized in that: The image data set is annotated by extracting magnetic moment data from the material database.
4. The magnetic prediction method of doped two-dimensional nanomaterials based on Swin-Resnet as claimed in claim 1, characterized in that: The data enhancement methods include: horizontal flip enhancement, vertical enhancement, mirror symmetry enhancement, affine change, rotation, Gaussian noise, contrast change, scale conversion and translation.
5. The magnetic prediction method of doped two-dimensional nanomaterials based on Swin-Resnet as claimed in claim 1, characterized in that: The SwinT module uses Reshape to convert the data dimension. At the same time, LayerNorm is moved back and set behind Window Attention, MLP, and ShitWindow Attention. After the SwinT module is processed, Conv2D convolution is used to process it into two-dimensional data.
6. The magnetic prediction method of doped two-dimensional nanomaterials based on Swin-Resnet as claimed in claim 1, characterized in that: During the model training process, the parameters are set as follows: the number of training rounds is 1000, the learning rate is 0.01, the optimizers are SGD, Momentum and RMSProp, the loss function is CrossEntropyLoss, and the batch_size is 64.
