A crystal property prediction method based on a graph neural network
By introducing edge convolution operators and related self-attention mechanisms into the graph neural network architecture, a crystal property prediction model is constructed, which solves the problem of difficulty in capturing long-range atomic information in existing methods and achieves high-precision crystal property prediction.
Patent Information
- Application Number
- CN202510041458.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2045-01-10
AI Technical Summary
Existing machine learning methods have difficulty effectively capturing long-range information between atoms when predicting crystal properties, resulting in insufficient prediction accuracy.
A graph neural network-based method is adopted, and the edge convolution operator and related self-attention mechanism are introduced to construct a crystal property prediction model. The crystal graph is formed by encoding nodes and edges, and prediction is performed using convolutional layers, attention layers, pooling layers and fully connected layers.
It improves the accuracy of crystal property prediction, enhances the ability to extract local and non-local information of atoms, and improves the accuracy of atomic embedding.
Smart Images

Figure CN119851807B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of materials science, and in particular to a method for predicting crystal properties based on graph neural networks. Background Art
[0002] In recent years, ab initio calculations based on density functional theory (DFT) have become an essential component of scientific research in disciplines such as physics, chemistry, and materials science. However, a key issue with DFT is its high computational complexity, which has hindered its application in studying crystal systems containing thousands of atoms.
[0003] To address this challenge, machine learning methods have been introduced. Machine learning methods can predict crystal properties at a low computational cost by learning patterns and regularities from large amounts of data. According to existing research, machine learning methods are changing the processes related to the discovery and design of materials and molecules at an astonishing rate through direct statistical learning and the analysis of large data sets. However, the effectiveness of machine learning methods in materials science depends heavily on the rational representation of materials and molecules. Specifically, this representation must be encoded as a fixed-length vector to be compatible with machine learning algorithms, and the variability of crystal structure size makes this requirement more complicated.
[0004] Compared with traditional machine learning methods, deep learning technology has shown significant advantages in dealing with the prediction of crystal properties. Traditional methods often rely on features designed manually by experts, which require complex preprocessing and rational representation of the data, while deep learning methods can directly process raw data without tedious feature engineering. Through its layered neural network structure, the deep learning model can automatically learn complex and abstract features in the data, thereby effectively capturing the key properties of materials and molecules. After the crystal graph convolutional neural network known to the inventors, the use of graph neural network models to predict crystal properties has attracted widespread attention. However, in the process of improving the method based on the graph convolutional neural network, it is generally difficult to grasp the long-range information between atoms, and thus it is impossible to achieve high-precision prediction of crystal properties. Summary of the Invention
[0005] The purpose of this application is to provide a crystal property prediction method based on graph neural network, which can grasp the long-range information between atoms and thus achieve high-precision prediction of crystal properties.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] This application provides a method for predicting crystal properties based on graph neural networks, including:
[0008] The atoms of the crystal to be predicted are used as nodes and the atomic bonds are used as edges. The nodes and edges are encoded to obtain node feature vectors and edge feature vectors to form a crystal graph; each node includes the atom type and the atomic position coordinates; each edge includes the bond type and bond strength;
[0009] Based on the graph neural network architecture, the edge convolution operator and the related self-attention mechanism are introduced to construct a crystal property prediction model. In terms of data processing, the graph neural network architecture includes convolutional layers, attention layers, pooling layers, and fully connected layers.
[0010] The crystal graph is input into the crystal property prediction model to obtain a crystal property prediction result.
[0011] Optionally, based on the graph neural network architecture, an edge convolution operator and related self-attention mechanism are introduced to construct a crystal property prediction model, including:
[0012] Based on the graph neural network architecture, we introduce the edge convolution operator and the related self-attention mechanism to build an initial crystal property prediction model;
[0013] Obtaining a sample training set and a sample test set; wherein the sample training set and the sample test set both include sample pairs formed by a crystal image and a calibrated crystal property corresponding to the crystal image;
[0014] Using the sample training set to train the initial crystal property prediction model to obtain a trained initial crystal property prediction model;
[0015] The trained initial crystal property prediction model is tested using the sample test set until an output error of the trained initial crystal property prediction model meets a set threshold, thereby obtaining a trained initial crystal property prediction model;
[0016] The trained initial crystal property prediction model is used as the crystal property prediction model.
[0017] Optionally, based on the graph neural network architecture, an edge convolution operator and related self-attention mechanism are introduced to construct an initial crystal property prediction model, including:
[0018] The edge convolution operator is used as a new convolution form to replace the convolution form of the convolution layer in the graph neural network architecture to obtain a new convolution layer;
[0019] Introducing the related self-attention mechanism into the graph neural network architecture to obtain a new attention layer;
[0020] Based on the new convolutional layer and the new attention layer, the pooling layer and the fully connected layer are combined to obtain an initial crystal property prediction model.
[0021] Optionally, inputting the crystal graph into the crystal property prediction model to obtain a crystal property prediction result includes:
[0022] The crystal graph is input into a new convolutional layer of the crystal property prediction model to obtain convolutional layer output features; the convolutional layer output features are represented by a query matrix, a key matrix, and a value matrix; the query matrix, the key matrix, and the value matrix are all obtained through the new convolutional layer transformation;
[0023] Determine attention weights based on the query matrix and the key matrix to obtain an attention weight matrix;
[0024] Normalizing the attention weights in the attention weight matrix to obtain a final attention weight matrix;
[0025] Obtaining a related self-attention feature matrix based on the final attention weight matrix and the value matrix using the related self-attention mechanism;
[0026] Obtaining a relevant self-attention layer output feature matrix based on the relevant self-attention feature matrix and the convolutional layer output features;
[0027] The pooling layer is used to perform a pooling operation on the feature matrix output by the self-attention layer to obtain the overall feature vector of the crystal;
[0028] The overall eigenvector of the crystal is processed using a fully connected layer to obtain the crystal property prediction result.
[0029] Optionally, the attention weight matrix is expressed as:
[0030]
[0031] Where, is the attention weight matrix, Softmax is the activation function, Q is the query matrix, T is the transpose of the matrix, d a is the second dimension of the bond matrix, and K is the bond matrix.
[0032] Optionally, normalizing the attention weights in the attention weight matrix to obtain a final attention weight matrix includes:
[0033] The attention weight is normalized to obtain the final attention weight; wherein the final attention weight is expressed as:
[0034]
[0035] The final attention weight matrix is obtained based on the final attention weight; wherein the final attention weight matrix is expressed as:
[0036] A=[αi,j ];
[0037] Where A is the final attention weight matrix, α i,j is the final attention weight, is the attention weight, is the average of the i-th row of the attention weight matrix.
[0038] Optionally, the relevant self-attention feature matrix is expressed as:
[0039] F csa =A·V;
[0040] Where, F csa is the relevant self-attention feature matrix, A is the final attention weight matrix, and V is the value matrix of the new convolutional layer output.
[0041] Optionally, the self-attention layer output feature is expressed as:
[0042] F out =LBR(F csa -F in )+F in ;
[0043] Where, F out is the output feature matrix of the new attention layer, F in is the feature matrix of the new attention layer, F csa is the related self-attention feature matrix, and LBR represents a network containing linear, batch normalization, and ReLU layers.
[0044] Optionally, a LeakyReLU activation function is used as the activation function of the new convolutional layer.
[0045] Optionally, the node feature vector updated using the new convolutional layer is expressed as:
[0046]
[0047] Where, is the updated feature vector of node i, is the constructed crystal graph, is the new weight parameter, is the eigenvector of node j, is the feature vector of node i, || represents the connector, and LeakyReLU is the activation function.
[0048] According to the specific embodiments provided in this application, this application has the following technical effects:
[0049] This application provides a crystal property prediction method based on graph neural network. By introducing edge convolution operators and related self-attention mechanisms on the basis of graph neural network architecture, a crystal property prediction model is constructed. It can not only effectively enhance the ability to extract local and non-local information of atoms, but also improve the accuracy of atomic embedding, thereby improving the accuracy of crystal property prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0051] Figure 1 A schematic diagram of a flow chart of a method for predicting crystal properties based on a graph neural network provided in one embodiment of the present application;
[0052] Figure 2 A schematic diagram of an implementation flow of a method for predicting crystal properties based on a graph neural network provided in one embodiment of the present application;
[0053] Figure 3 A schematic diagram of a crystal map construction process according to another embodiment of the present application;
[0054] Figure 4 A schematic diagram of the convolutional layer structure provided in one embodiment of the present application;
[0055] Figure 5 A schematic diagram of the attention layer structure provided in one embodiment of the present application;
[0056] Figure 6 A schematic diagram of a process for predicting crystal properties based on a graph neural network according to an embodiment of the present application;
[0057] Figure 7 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0059] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0060] In an exemplary embodiment, the present application provides a method for predicting crystal properties based on a graph neural network. The method is executed by a computer device, specifically a computer device such as a terminal or a server, or a terminal and a server. In the embodiment of the present application, the method is applied to a server as an example for description. Figure 1 As shown, the method includes:
[0061] Step 100: The atoms of the crystal to be predicted are used as nodes, and the atomic bonds are used as edges. The nodes and edges are encoded to obtain node feature vectors and edge feature vectors to form a crystal graph. Each node includes the atom type and the atomic position coordinates. Each edge includes the bond type and bond strength.
[0062] Step 101: Based on the graph neural network architecture, the edge convolution operator and the related self-attention mechanism are introduced to construct a crystal property prediction model. In terms of data processing, the graph neural network architecture includes convolutional layers, attention layers, pooling layers, and fully connected layers.
[0063] Step 102: Input the crystal image into the crystal property prediction model to obtain the crystal property prediction result.
[0064] In another exemplary embodiment of the present application, the crystal structure has periodicity and symmetry, which is essentially similar to the way the nodes and edges of a graph are connected. Based on this, in step 100, combined with graph theory, the crystal is abstracted into a crystal graph, where the nodes and edges represent the atoms in the crystal structure and the bonds between them, respectively. In the crystal graph, the nodes represent individual atoms in the crystal. Each node has specific characteristics, such as the type of atom and the position coordinates. Each edge also has specific characteristics, including the type and strength of the bond. Therefore, from a mathematical point of view, the crystal structure can be modeled as follows Figure 3 The undirected multigraph shown Unlike ordinary molecular graphs, due to the periodicity of crystal graphs, multiple edges are allowed between node pairs. In crystal graphs, nodes and edges are encoded to generate a feature vector v representing the node. i and the eigenvector representing the edge That is, the edge between nodes i and j.
[0065] In another exemplary embodiment of the present application, the implementation process of step 101 may include:
[0066] Step 1: Based on the graph neural network architecture, introduce the edge convolution operator and the related self-attention mechanism to build an initial crystal property prediction model.
[0067] (1) The edge convolution operator is used as a new convolution form to replace the convolution form of the convolution layer in the graph neural network architecture to obtain a new convolution layer.
[0068] (2) Introduce the relevant self-attention mechanism into the graph neural network architecture to obtain a new attention layer.
[0069] (3) Based on the new convolutional layer and the new attention layer, the initial crystal property prediction model is obtained by combining the pooling layer and the fully connected layer.
[0070] Step 2: Obtain a sample training set and a sample test set. Both the sample training set and the sample test set include sample pairs formed by crystal images and calibrated crystal properties corresponding to the crystal images.
[0071] Step 3: Use the sample training set to train the initial crystal property prediction model to obtain a trained initial crystal property prediction model.
[0072] Step 4: Use the sample test set to test the trained initial crystal property prediction model until the output error of the trained initial crystal property prediction model meets the set threshold, thereby obtaining the trained initial crystal property prediction model.
[0073] Among them, during the training process, the predicted crystal property values are obtained After that, the density functional theory value y i The mean absolute error MAE, correlation coefficient ρ and determination coefficient R 2 The calculation formulas for the three are:
[0074]
[0075] Where M is the number of predicted crystal properties, is the mean of the M predicted density functional theory values, is the mean of the predicted M crystal property values.
[0076] By judging the mean absolute error MAE, correlation coefficient ρ and determination coefficient R 2 The size of the edgeConv-GANN is used to determine the quality of the trained crystal property prediction model (hereinafter referred to as the model or EdgeConv-GANN), and then the network parameters are updated through backpropagation until the model converges.
[0077] For example, in practical applications, the architecture of the crystal property prediction model primarily consists of convolutional layers, attention layers, and fully connected layers. It includes three convolutional layers, each followed by batch normalization and a LeakyReLU activation function. These three convolutional layers progressively increase the atomic feature dimensions from 32 to 64, 128, and 512 dimensions before entering the attention layer. After the attention layer, the atomic feature dimensions increase to 1536 dimensions. The final portion of the EdgeConv-GANN architecture consists of three fully connected layers, each followed by batch normalization except the last. The dimensions of these three fully connected layers are as follows: the first layer maps from 1536 to 1024 dimensions, the second layer reduces from 1024 to 512 dimensions, and the final layer maps the 512-dimensional features to the final output channels. All weights and other learnable parameters throughout the EdgeConv-GANN architecture are iteratively updated using mini-batch stochastic gradient descent and the Adam optimizer. The loss function is determined by the mean squared error between the predicted properties and the reference data calculated using the DFT. In order to allow the model to fully learn and tune its parameters for optimal performance, 200 training epochs were performed in each case. All training tasks in this work were performed using PyTorch.
[0078] This application uses the Adam optimizer to train the detector, and the basic learning rate, batch size, training number ratio, validation number ratio, and test number ratio steps are set to 0.01, 64, 0.8, 0.1, and 0.1 respectively, and the number of training rounds is 200.
[0079] Step 5: Use the trained initial crystal property prediction model as the crystal property prediction model. After the training is completed, save the best weight information, and then use the weight directly to predict the properties of the input crystal structure in the test phase to obtain the predicted value of the crystal property. Based on this, in the actual application process, the entire implementation process can be referred to Figure 2 The process shown.
[0080] Based on the above description, the crystal property prediction model finally constructed is as follows Figure 6 As shown, it can include Figure 4 The new convolutional layer shown in Figure 5 Based on this, in step 102, the crystal graph is input into the crystal property prediction model, and the process of obtaining the crystal property prediction result includes:
[0081] Step 1: The crystal graph is input into the new convolutional layer of the crystal property prediction model to obtain the convolutional layer output features. The convolutional layer output features are represented by a query matrix, a key matrix, and a value matrix. The query matrix, key matrix, and value matrix are all transformed through the new convolutional layer.
[0082] Step 2: Determine the attention weight based on the query matrix and the key matrix to obtain the attention weight matrix. The attention weight matrix is expressed as:
[0083]
[0084] Where, is the attention weight matrix, Softmax is the activation function, Q is the query matrix, T is the transpose of the matrix, d a is the second dimension of the bond matrix, K is the bond matrix, is the attention weight.
[0085] Step 3: Normalize the attention weights in the attention weight matrix to obtain the final attention weight matrix. For example:
[0086] The attention weight is normalized to obtain the final attention weight. The final attention weight is expressed as:
[0087]
[0088] The final attention weight matrix is obtained based on the final attention weight. The final attention weight matrix is expressed as:
[0089] A=[α i,j ].
[0090] Where A is the final attention weight matrix, α i,j is the final attention weight, is the attention weight, is the average of the i-th row of the attention weight matrix.
[0091] Step 4: Use the relevant self-attention mechanism to obtain the relevant self-attention feature matrix based on the final attention weight matrix and value matrix. The relevant self-attention feature matrix is expressed as:
[0092] F csa =A·V.
[0093] Where, F csa is the relevant self-attention feature matrix, A is the final attention weight matrix, and V is the value matrix of the new convolutional layer output.
[0094] Step 5: Obtain the relevant self-attention layer output feature matrix based on the relevant self-attention feature matrix and the convolutional layer output features. The relevant self-attention layer output feature matrix is expressed as:
[0095] F out =LBR(F csa -F in )+F in.
[0096] Where, F out is the output feature matrix of the new attention layer, F in is the feature matrix of the new attention layer, F csa Is the related self-attention feature matrix, LBR represents a network containing linear, batch normalization and ReLU activation functions. Among them, using (F csa -F in ) to enhance the relevant self-attention layer is of great significance for extracting the global information of nodes in graph networks.
[0097] Step 6: Use the pooling layer to pool the output features of the self-attention layer to obtain the overall feature vector of the crystal.
[0098] Step 7: Use the fully connected layer to process the overall feature vector of the crystal to obtain the crystal property prediction result.
[0099] In another exemplary embodiment of the present application, a convolutional neural network module is constructed based on a crystal graph, typically by passing messages related to neighboring atoms and bonds to update atomic embeddings. However, known deep network models are often affected by the strongest neighbor node effect, or are unable to effectively grasp the interaction strength of bonds. In order to solve this problem, the present application introduces a new form of convolution in the above step 101 - the edge convolution operator, which can directly extract interaction features from all bonds adjacent to each atom. Based on this, combined with the above content, the process of executing the edge convolution operator is explained.
[0100] In this application, the edge convolution operator is applied to the atomic structure, where the updated atomic embedding is output through a channel mean aggregation strategy rather than a maximum aggregation strategy, in contrast to known methods. In addition, instead of using the widely used ReLU activation function, the LeakyReLU activation function is used to make the crystal property prediction model more stable and robust. The LeakyReLU activation function is chosen because the ReLU function provides zero output when the input is negative. This phenomenon may cause the weights of some neurons to no longer update during training because their gradients are permanently zero.
[0101] Among them, the ReLU function is expressed as: f(x)=max(0,x), f(x) is the function value, x is the independent variable, and max() is the maximum value function.
[0102] To address the limitation of the ReLU function in the negative half of the ReLU interval, the leaky value is given a non-zero slope λ, based on which the LeakyReLU activation function is expressed as:
[0103]
[0104] The introduction of the LeakyReLU activation function can ensure that neurons remain active when receiving negative inputs, thereby improving the ability of the crystal property prediction model. More specifically, the process of updating the node feature vector in the first convolutional layer of the crystal property prediction model (referred to as EdgeConv-GANN) can be described as:
[0105]
[0106] wherein, represents a learnable weight parameter, t represents the current convolutional layer, and here t = 0. For subsequent convolutional layers, considering the topological characteristics inherent in graph data and existing applications, the edge convolution operator is modified to a more efficient form, which is:
[0107]
[0108] wherein and θ′ m are different learnable weight parameters from . Since multiple linear layer operations can increase computational complexity, it is considered to simplify the calculation and make it more practical with the following formula:
[0109]
[0110] wherein, is the updated feature vector of node i, is the crystal graph constructed, is the new weight parameter, is the feature vector of node j, is the feature vector of node i, and || represents the connector. LeakyReLU is the LeakyReLU activation function.
[0111] After R convolutional layers, the feature vector of node i is updated according to the local environment of the atom corresponding to the node. By using this form of convolution calculation, the global environment of the atom can be considered.
[0112] In another exemplary embodiment of the present application, based on the content of performing the edge convolution operator given above, in this embodiment, the convolutional layer output feature can be represented as wherein N is the number of atoms, d g is the feature dimension, is a real matrix with dimensions * × *. In order to calculate the relevant self-attention, the input feature is linearly transformed by the convolutional layer to obtain the query matrix Q, the key matrix K and the value matrix V, which are:
[0113] (Q,K,V)=F in ·(W q,W k ,W v ).
[0114] Where, is a learnable linear transformation matrix, considering d g May not be equal to d e In this embodiment, d e Set to d g / 4 to improve computational efficiency. The attention weights of atoms are captured by the matrix product of query and key.
[0115] In this application, using the query matrix Q and the bond matrix K respectively can more effectively extract the relevant information between the query and bond matrices, thereby better evaluating the atomic attention weights. These attention weights are further normalized to obtain the final attention weight matrix. The final attention weight matrix is normalized on the second dimension by l1-norm, which can reduce the influence of other noises and facilitate the execution of subsequent tasks, thereby obtaining the relevant self-attention feature matrix F. csa Finally, we further use the input feature matrix F in and the related self-attention feature matrix F csa To generate the entire attention layer output feature matrix F out .
[0116] Further, execute the pooling operator:
[0117] After performing R convolutional layers and attention layers, local and global information can be extracted. The feature vector v of each node i i R All are learned automatically, and the overall feature vector v of the crystal is generated through the pooling layer c Among them, the overall characteristic vector v of the crystal c It can be expressed as a pooling function:
[0118]
[0119] Finally, the overall feature vector v of the crystal is calculated through three fully connected layers. c Processing is performed to complete predictions from atomic structure to material properties.
[0120] In another example embodiment of the present application, in order to quantitatively evaluate the performance of the method provided in the present application, the present embodiment compares the band gap of the Quantum Metal-Organic Framework (QMOF) dataset by using different methods (Sine CM (Sine Coulomb matrix), SM-45 (Stoichiometric-45), SM-120 (Stoichiometric-120), OFM (Orbital Field Matrix), SOAP (Smooth Overlap of Atomic Positions), CGCNN (Crystal Graph Convolutional Neural Network), SchNet, GATGNN (Global Attention Graph Neural Network), GANN (Graph Attention Neural Network) and EdgeConv-GANN (the present application)) to illustrate the average precision of five experiments selected in the present embodiment. The smaller the average absolute error MAE, the larger the correlation coefficient p and the determination coefficient R 2 represent that the precision of the model is higher. The prediction results of the band gap in the QMOF dataset are shown in Table 1. Based on Table 1, it can be known that the crystal prediction method provided in the present application is better than the comparison methods in each index.
[0121] Table 1: Prediction results of band gap in QMOF dataset
[0122] method MAE(eV) <![CDATA[R 2 ]]> ρ SineCM 0.529(0.008) 0.643(0.012) 0.787(0.008) SM-45 0.437(0.004) 0.743(0.006) 0.842(0.004) SM-120 0.433(0.010) 0.750(0.009) 0.847(0.005) OFM 0.417(0.008) 0.763(0.010) 0.863(0.003) SOAP 0.357(0.008) 0.822(0.010) 0.910(0.003) CGCNN 0.274(0.008) 0.876(0.011) 0.932(0.005) SchNet 0.258(0.008) 0.885(0.009) 0.937(0.005) GATGNN 0.260(0.005) 0.882(0.007) 0.935(0.004) GANN 0.235(0.005) 0.900(0.008) 0.946(0.006) EdgeConv-GANN (this application) 0.224(0.006) 0.910(0.010) 0.955(0.007)
[0123] In an example embodiment, a computer device is provided, which can be a server or a terminal, and the internal structure diagram thereof can be as shown in Figure 7As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store crystal property prediction data based on graph neural networks. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a crystal property prediction method based on a graph neural network is implemented.
[0124] Those skilled in the art will understand that Figure 7 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application and does not constitute a limitation on the computer device to which the solution of the present application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.
[0125] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0126] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0127] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0128] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0129] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.
[0130] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0131] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for predicting crystal properties based on graph neural networks, characterized in that: The crystal property prediction method based on graph neural network includes: Step 100: The atoms of the crystal to be predicted are used as nodes, and the atomic bonds are used as edges. The nodes and edges are encoded to obtain node feature vectors and edge feature vectors to form a crystal graph; each node includes the atom type and the atomic position coordinates; each edge includes the bond type and bond strength; Step 101: Based on the graph neural network architecture, an edge convolution operator and a related self-attention mechanism are introduced to construct a crystal property prediction model; along the data processing direction, the graph neural network architecture includes a convolution layer, an attention layer, a pooling layer, and a fully connected layer in sequence; The edge convolution operator is used as a new convolution form to replace the convolution form of the convolution layer in the graph neural network architecture to obtain a new convolution layer; the LeakyReLU activation function is used as the activation function of the new convolution layer; the node feature vector updated by the new convolution layer is expressed as: ; Where, Is the updated node The eigenvector of is the constructed crystal graph, is the new weight parameter, is a node The eigenvector of is a node The eigenvector of Indicates a connector. is the activation function; Introducing the related self-attention mechanism into the graph neural network architecture to obtain a new attention layer; Based on the new convolutional layer and the new attention layer, the pooling layer and the fully connected layer are combined to obtain an initial crystal property prediction model; Step 102: inputting the crystal image into the crystal property prediction model to obtain a crystal property prediction result; The crystal graph is input into the new convolution layer of the crystal property prediction model to obtain the output features of the convolution layer; the output features of the convolution layer are expressed as ; is the number of atoms, is the feature dimension, The dimension is A real matrix of ; The output features of the convolutional layer As the input feature of the relevant self-attention, the query matrix is obtained by linear transformation of the convolution layer , key matrix Sum Matrix ,have: ; Where, , and is a learnable linear transformation matrix, for ; Based on the query matrix and the bond matrix Determine the attention weight and obtain the attention weight matrix; the attention weight matrix is expressed as: ; Where, is the attention weight matrix, is the activation function, is the transpose of the matrix, is the second dimension of the bond matrix; The attention weight is normalized to obtain the final attention weight; the final attention weight is expressed as : ; Where, is the attention weight, is the attention weight matrix The average value of the row; The final attention weight matrix is obtained based on the final attention weight; the final attention weight matrix is expressed as : ; The related self-attention mechanism is used to obtain the related self-attention feature matrix based on the final attention weight matrix and the value matrix; the related self-attention feature matrix is expressed as : ; Based on the relevant self-attention feature matrix and the convolutional layer output features, the relevant self-attention layer output feature matrix is obtained; the self-attention layer output feature is expressed as : ; Where, Represents a network containing linear, batch normalization, and ReLU layers; The pooling layer is used to perform a pooling operation on the feature matrix output by the self-attention layer to obtain the overall feature vector of the crystal; The overall eigenvector of the crystal is processed using a fully connected layer to obtain the crystal property prediction result.
2. The method for predicting crystal properties based on graph neural network according to claim 1, characterized in that: Based on the graph neural network architecture, we introduce the edge convolution operator and the related self-attention mechanism to construct a crystal property prediction model, including: Obtaining a sample training set and a sample test set; wherein the sample training set and the sample test set both include sample pairs formed by a crystal image and a calibrated crystal property corresponding to the crystal image; Using the sample training set to train the initial crystal property prediction model to obtain a trained initial crystal property prediction model; The trained initial crystal property prediction model is tested using the sample test set until an output error of the trained initial crystal property prediction model meets a set threshold, thereby obtaining a trained initial crystal property prediction model; The trained initial crystal property prediction model is used as the crystal property prediction model.