Graph data classification model training method and device, equipment and storage medium
By performing correlation sampling on the initial adjacency matrix of graph data samples and the edges in sparse graph data samples, the oversmoothing problem in graph data classification models is solved, enabling accurate and fast model training and improving classification performance.
Patent Information
- Application Number
- CN202111616419.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-06-11
- Filing Date
- 2021-12-27
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-02-10
AI Technical Summary
As the number of layers in a graph data classification model increases, oversmoothing issues arise, affecting model performance.
By performing correlation sampling on the initial adjacency matrix of graph data samples, the edges in the sparse graph data samples are associated with graph data features, avoiding the oversmoothing problem, and training a graph data classification model.
Accurately and quickly train graph data classification models to improve classification performance.
Smart Images

Figure CN114332480B_ABST
Abstract
Description
[0001] This application is a divisional application of application number 202110655776.7, filed on June 11, 2021, entitled "Graph Data Classification Model Training Method, Apparatus, Device and Storage Medium". Technical Field
[0002] This application relates to artificial intelligence technology, and more particularly to a training method, apparatus, electronic device, and computer-readable storage medium for an AI-based graph data classification model. Background Technology
[0003] Artificial Intelligence (AI) is a comprehensive technology within computer science that studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities. AI technology is a multidisciplinary field, encompassing a wide range of areas, including natural language processing and machine learning / deep learning. With technological advancements, AI will be applied in more fields and play an increasingly important role.
[0004] Graph data has a long history of helping humans communicate, understand the world, and solve scientific problems. Graph data classification is an important research direction in the field of artificial intelligence. Graph data classification refers to the process of determining the type of graph data based on its structure. Today, graph data classification is widely used in fields such as social networks, financial risk control, and drug development.
[0005] However, when using graph data classification models to classify graph data, the problem of oversmoothing can occur as the number of model layers increases, which in turn affects the performance of graph data classification models. Summary of the Invention
[0006] This application provides a training method, apparatus, electronic device, and computer-readable storage medium for an artificial intelligence-based graph data classification model, which can improve the classification performance of the graph data classification model.
[0007] The technical solution of this application embodiment is implemented as follows:
[0008] This application provides a training method for an artificial intelligence-based graph data classification model, including:
[0009] Obtain the initial adjacency matrix corresponding to multiple edges in the graph data sample;
[0010] The initial adjacency matrix corresponding to the multiple edges is subjected to associative sampling processing to obtain the sampled adjacency matrix;
[0011] Based on the sampling adjacency matrix, feature extraction processing is performed on the graph data samples to obtain the graph data features of the graph data samples;
[0012] A graph data classification model is trained based on the graph data features of the graph data samples.
[0013] The trained graph data classification model is used to perform type prediction processing on the graph data to be classified, so as to obtain the type to which the graph data to be classified belongs.
[0014] This application provides a training apparatus for a graph data classification model, comprising:
[0015] The acquisition module is used to obtain the initial adjacency matrix corresponding to multiple edges in the graph data sample;
[0016] The sampling module is used to perform correlation sampling processing on the initial adjacency matrix corresponding to the multiple edges to obtain the sampled adjacency matrix;
[0017] The feature extraction module is used to perform feature extraction processing on the graph data sample based on the sampling adjacency matrix to obtain the graph data features of the graph data sample;
[0018] The training module is used to train a graph data classification model based on the graph data features of the graph data samples; wherein, the trained graph data classification model is used to perform type prediction processing on the graph data to be classified to obtain the type to which the graph data to be classified belongs.
[0019] In the above technical solution, the graph data classification model includes multiple cascaded hidden layers;
[0020] The sampling module is further configured to perform associative sampling processing on the initial adjacency matrix corresponding to the plurality of edges through each hidden layer to obtain the sampling adjacency matrix corresponding to each hidden layer;
[0021] The feature extraction module is further used to perform cascaded feature extraction processing on the graph data samples based on the sampling adjacency matrices corresponding to the multiple cascaded hidden layers, so as to obtain the graph data features of the graph data samples.
[0022] In the above technical solution, the sampling module is further configured to perform weighted processing on the sampling parameters corresponding to the plurality of edges through any of the hidden layers to obtain a set of weighted sampling parameters corresponding to each hidden layer;
[0023] The initial adjacency matrix is sampled based on the weighted sampling parameter set corresponding to each hidden layer to obtain the sampled adjacency matrix corresponding to each hidden layer.
[0024] In the above technical solution, the sampling module is further used to perform similarity processing on the node features of the two nodes corresponding to any edge through each hidden layer to obtain the similarity between the two nodes corresponding to any edge;
[0025] Based on the similarity between the two nodes, determine the weight corresponding to any of the edges;
[0026] The sampling parameters corresponding to any one of the edges are weighted based on the weights corresponding to any one of the edges to obtain the weighted sampling parameters corresponding to any one of the edges.
[0027] A set of weighted sampling parameters corresponding to each of the hidden layers is formed based on a set of weighted sampling parameters corresponding to multiple edges.
[0028] In the above technical solution, the sampling module is further used to sum the similarity between two nodes corresponding to multiple edges to obtain a summation result;
[0029] The ratio of the similarity between the two nodes corresponding to any edge to the summation result is used as the weight of any edge.
[0030] In the above technical solution, the sampling module is further configured to perform the following processing through the j-th hidden layer of the plurality of cascaded hidden layers:
[0031] The sampling adjacency matrix corresponding to the (j-1)th hidden layer is recursively sampled to obtain the sampling adjacency matrix corresponding to the j-th hidden layer.
[0032] Where j is an increasing natural number with a value range of 2≤j≤N, N is the number of the multiple cascaded hidden layers, and the sampling adjacency matrix corresponding to the first hidden layer is obtained by sampling the initial adjacency matrix based on the sampling parameters corresponding to the multiple edges.
[0033] In the above technical solution, the sampling module is further used to perform difference processing on the initial adjacency matrix and the sampling adjacency matrix corresponding to the (j-1)th hidden layer to obtain a first difference adjacency matrix, wherein the first difference adjacency matrix includes the unsampled edges in the (j-1)th hidden layer;
[0034] The first difference adjacency matrix is sampled based on the sampling parameters corresponding to the multiple edges to obtain the sampled first difference adjacency matrix.
[0035] The sampling adjacency matrix corresponding to the (j-1)th hidden layer is summed with the sampling first difference adjacency matrix to obtain the sampling adjacency matrix corresponding to the jth hidden layer.
[0036] In the above technical solution, the sampling module is further used to perform weighted processing on the sampling parameters corresponding to the multiple edges respectively to obtain a weighted sampling parameter set;
[0037] The first difference adjacency matrix is sampled based on the weighted sampling parameter set to obtain the sampled first difference adjacency matrix.
[0038] In the above technical solution, the sampling module is further used to perform sampling processing on the sampling adjacency matrix corresponding to the (j-1)th hidden layer based on the sampling parameters corresponding to the plurality of edges respectively, to obtain a second sampling adjacency matrix;
[0039] The sampling adjacency matrix corresponding to the (j-1)th hidden layer is subjected to a difference processing with the sampling second adjacency matrix, and the resulting sampling second difference adjacency matrix is used as the sampling adjacency matrix corresponding to the jth hidden layer.
[0040] In the above technical solution, the sampling module is further used to perform weighted processing on the sampling parameters corresponding to the multiple edges respectively to obtain a weighted sampling parameter set;
[0041] Based on the weighted sampling parameter set, the sampling adjacency matrix corresponding to the (j-1)th hidden layer is sampled to obtain the second sampling adjacency matrix.
[0042] In the above technical solution, the sampling module is further used to perform feature extraction processing on the graph data sample by combining the first hidden layer of the multiple cascaded hidden layers with the sampling adjacency matrix corresponding to the first hidden layer;
[0043] The feature extraction result of the first hidden layer is output to the subsequent cascaded hidden layers, so that feature extraction processing and feature extraction result output can continue in the subsequent cascaded hidden layers until the last hidden layer is output.
[0044] The feature extraction result output by the last hidden layer is used as the graph data feature of the graph data sample.
[0045] In the above technical solution, the sampling module is further configured to perform the following processing through the i-th hidden layer of the plurality of cascaded hidden layers:
[0046] The sampling adjacency matrix corresponding to the i-th hidden layer, the feature extraction result of the (i-1)-th hidden layer, and the learnable parameter matrix of the i-th hidden layer are multiplied to obtain the feature extraction result of the i-th hidden layer, and the feature extraction result of the i-th hidden layer is output to the (i+1)-th hidden layer.
[0047] Where i is an increasing natural number and its value ranges from 2 ≤ i ≤ N-1, and N is the number of the multiple cascaded hidden layers.
[0048] In the above technical solution, the training module is further used to perform type prediction processing on the graph data features of the graph data sample through the graph data classification model to obtain the predicted type of the graph data sample;
[0049] Based on the predicted type of the graph data sample and the type label of the graph data sample, the loss function of the graph data classification model is constructed.
[0050] Update the parameters of the graph data classification model until the loss function converges, and use the updated parameters of the graph data classification model when the loss function converges as the parameters of the trained graph data classification model.
[0051] This application provides an electronic device for training a graph data classification model, the electronic device comprising:
[0052] Memory, used to store executable instructions;
[0053] The processor, when executing executable instructions stored in the memory, implements the training method for the AI-based graph data classification model provided in the embodiments of this application.
[0054] This application provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the AI-based graph data classification model training method provided in this application.
[0055] The embodiments of this application have the following beneficial effects:
[0056] By performing correlation sampling on the initial adjacency matrix of graph data samples, the edges in the graph data samples are sparsed in a regular manner. This associates graph data features with graph data samples, avoiding the oversmoothing problem in graph data classification. As a result, the graph data classification model is trained accurately and quickly, improving the classification performance of the graph data classification model. Attached Figure Description
[0057] Figure 1 This is a schematic diagram illustrating an application scenario of the graph data classification system provided in this application embodiment;
[0058] Figure 2 This is a schematic diagram of the structure of an electronic device for graph data classification provided in an embodiment of this application;
[0059] Figures 3-6 This is a flowchart illustrating the training method for a graph data classification model based on artificial intelligence provided in an embodiment of this application.
[0060] Figure 7 This is a schematic diagram of the structure of the graph data classification model provided in the embodiments of this application;
[0061] Figure 8 This is a flowchart illustrating the training method for a graph data classification model based on artificial intelligence provided in an embodiment of this application.
[0062] Figure 9 This is a diagrammatic structure of the amino acids provided in the embodiments of this application;
[0063] Figure 10 This is a comparative schematic diagram of the training loss of the sampling algorithm provided in the embodiments of this application;
[0064] Figure 11 This is a comparative schematic diagram of the verification loss of the sampling algorithm provided in the embodiments of this application;
[0065] Figure 12 This is a comparative schematic diagram showing the average number of edges of the sampling algorithms provided in the embodiments of this application;
[0066] Figure 13 This is a comparative schematic diagram of the training loss of the sampling algorithm provided in the embodiments of this application;
[0067] Figure 14 This is a comparative schematic diagram of the verification loss of the sampling algorithm provided in the embodiments of this application;
[0068] Figure 15 This is a comparative schematic diagram of the verification loss of the kernel function provided in the embodiments of this application. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0070] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0072] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0073] 1) Graph data: An abstract data structure consisting of nodes and the connections between them. In real-world scenarios, nodes can represent people, organizations, goods, etc., while the connections between nodes, or edges, can represent social relationships between people, transactional relationships between goods, etc. In graph data, nodes can have their own attributes, given in the form of feature vectors, and edges are divided into directed and undirected.
[0074] 2) Dataset: Includes training set, validation set, and test set. The data in the training set is used to learn the parameters of the classification model; the validation set is used to evaluate the generalization of the model parameters obtained on the training set, and usually the set of model parameters that performs best on the validation set is selected for testing on the test set; the data in the test set is used to test the classification accuracy of the classification model.
[0075] 3) Adjacency Matrix: A matrix representing the adjacency relationships between nodes. For graph data, a two-dimensional array is used to store the data of the relationships (edges or arcs) between nodes; this two-dimensional array is called the adjacency matrix. Adjacency matrices are further divided into directed graph adjacency matrices and undirected graph adjacency matrices.
[0076] 4) Heuristic edge sampling (DropEdge): An algorithm that can mitigate the overfitting and oversmoothing problems of multi-layer GCNs. It randomly drops some edges in the graph during each training cycle and uses the sampled adjacency matrix and the original node features as outputs to the graph neural network for training.
[0077] Unlike Convolutional Neural Networks (CNNs), which improve capacity and performance with increasing depth after stacking multiple layers, graph data classification models (such as graph convolutional neural networks) often suffer from oversmoothing issues that hinder model training.
[0078] To address the aforementioned issues, embodiments of this application provide a method, apparatus, electronic device, and computer-readable storage medium for training graph data classification models based on artificial intelligence. These methods can avoid the oversmoothing problem during graph data classification and improve the classification performance of graph data classification models.
[0079] The AI-based graph data classification model training method provided in this application can be implemented by a terminal / server alone; or it can be implemented collaboratively by a terminal and a server. For example, the terminal can independently undertake the AI-based graph data classification model training method described below, or the terminal can send a classification request for the graph data to be classified to the server. The server executes the AI-based graph data classification model training method according to the received classification request, determines the type of the graph data to be classified, and responds to the classification request based on the type of the graph data to be classified, thereby realizing the graph data classification function.
[0080] The electronic device for training graph data classification models provided in this application can be various types of terminal devices or servers. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, smart vehicle, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0081] Taking servers as an example, such as server clusters deployed in the cloud, AI as a Service (AIaaS) is offered to users. The AIaaS platform breaks down several common AI services and provides them as independent or packaged services in the cloud. This service model is similar to an AI-themed marketplace, where all users can access and use one or more AI services provided by the AIaaS platform through application programming interfaces.
[0082] For example, one type of AI cloud service could be a graph data classification service, where a cloud-based server encapsulates the graph data classification program provided in this application embodiment. The cloud-deployed server calls the encapsulated graph data classification program to perform correlation sampling on the initial adjacency matrix, obtaining a sampled adjacency matrix (the sampled initial adjacency matrix). Based on the sampled adjacency matrix, it trains a graph data classification model, resulting in a trained graph data classification model. Users access the graph data classification service in the cloud service through a terminal (running a client, such as a drug development client, instant messaging client, or financial risk control client), enabling the cloud-deployed server to call the encapsulated graph data classification program. The trained graph data classification model then predicts the type of the graph data to be classified, thus determining the type of the graph data to be classified.
[0083] See Figure 1 , Figure 1 This is a schematic diagram of the application scenario of the graph data classification system 10 provided in the embodiments of this application. The terminal 200 is connected to the server 100 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0084] Terminals (running clients, such as drug development clients, instant messaging clients, financial risk control clients, etc.) can be used to obtain classification requests for graph data to be classified. For example, after a user enters graph data to be classified into the terminal's input interface, the terminal automatically obtains the classification requests for the graph data to be classified.
[0085] In some embodiments, after a terminal receives a classification request for graph data to be classified, it calls the graph data classification interface of server 100 (which can be provided as a cloud service, i.e., a graph data classification service). Before receiving the classification request for the graph data to be classified, server 100 performs correlation sampling on the initial adjacency matrix to obtain a sampled adjacency matrix (the sampled initial adjacency matrix), and trains a graph data classification model based on the sampled adjacency matrix to obtain the trained graph data classification model. After receiving the classification request for the graph data to be classified, the trained graph data classification model is used to predict the type of the graph data to be classified, thereby obtaining the type to which the graph data to be classified belongs, thus realizing the graph data classification function.
[0086] As an application example, in drug development, the model is first trained using graph data samples corresponding to various compound samples (e.g., the graph structure corresponding to a protein). This involves performing correlation sampling on the initial adjacency matrix corresponding to the compound samples to obtain a sampled adjacency matrix (the initial adjacency matrix after sampling). Based on the sampled adjacency matrix, feature extraction is performed on the graph data samples corresponding to the compound samples to obtain the graph data features of the compound samples. A graph data classification model is then trained based on these graph data features, resulting in the trained graph data classification model. When drug developers need to determine the type of a compound to be classified (e.g., whether it is toxic, carcinogenic, or hydrophilic), they call the graph data classification interface of server 100 through the drug development client. The trained graph data classification model then performs type prediction processing on the compound to be classified, determining its type. For example, if the compound is determined to be carcinogenic, subsequent anti-cancer research can be conducted based on this compound, laying the foundation for anti-cancer engineering.
[0087] In some embodiments, a graph data classification plugin can be embedded in the client running on the terminal to implement an AI-based graph data classification model training method locally on the client. For example, before the terminal receives a classification request for the graph data to be classified, it calls the graph data classification plugin to train the graph data classification model. This involves performing correlation sampling on the initial adjacency matrix to obtain a sampled adjacency matrix (the sampled initial adjacency matrix), and training the graph data classification model based on the sampled adjacency matrix to obtain the trained graph data classification model. After receiving a classification request for the graph data to be classified, the graph data classification plugin is called again. The trained graph data classification model then predicts the type of the graph data to be classified, thus determining the type of the graph data and implementing the graph data classification function.
[0088] As an application example, for instant messaging applications, model training is first performed using graph data samples (the graph structure corresponding to social networks) corresponding to multiple user samples. This involves performing correlation sampling on the initial adjacency matrices (including relationships between user samples) to obtain a sampled adjacency matrix (the initial adjacency matrix after sampling). Based on the sampled adjacency matrix, feature extraction is performed on the graph data samples to obtain graph data features. A graph data classification model is then trained based on these features, resulting in the trained graph data classification model. When quality inspectors need to determine the type of a social group, they use the instant messaging client to call the graph data classification plugin on terminal 200. The trained graph data classification model then performs type prediction processing on the social group to be classified (including multiple user accounts) to determine the type of the social group to be classified.
[0089] As an application example, for financial risk control applications, the model is first trained using graph data samples corresponding to multiple financial account samples. This involves performing correlation sampling on the initial adjacency matrix (including relationships between financial account samples) to obtain a sampled adjacency matrix (the initial adjacency matrix after sampling). Based on the sampled adjacency matrix, feature extraction is performed on the graph data samples to obtain graph data features. A graph data classification model is then trained based on these features, resulting in the trained graph data classification model. When risk control personnel need to determine whether recent financial market conditions pose a risk, they use the financial risk control client to call the graph data classification plugin on terminal 200. The trained graph data classification model then performs type prediction processing on the financial market conditions (including multiple financial accounts within a given period) for that period, determining the type of financial market conditions for that period. For example, if it is determined that the financial market conditions for a certain period are risky or volatile, subsequent investments can be rationally planned based on those conditions.
[0090] In some embodiments, multiple servers can form a blockchain, and server 100 is a node on the blockchain. Information connections can exist between each node in the blockchain, and information can be transmitted between nodes through these connections. The data related to the AI-based graph data classification method provided in this application (e.g., the logic of graph data processing, the type of graph data to be classified) can be stored on the blockchain.
[0091] The structure of the electronic device for training a graph data classification model provided in the embodiments of this application is described below. See also... Figure 2 , Figure 2 This is a schematic diagram of the structure of an electronic device 500 for training a graph data classification model provided in an embodiment of this application. The example is a server. Figure 2 The illustrated electronic device 500 for training a graph data classification model includes at least one processor 510, a memory 550, and at least one network interface 520. The various components in the electronic device 500 are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 2 The general labeled all buses as Bus System 540.
[0092] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0093] Memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory. Memory 550 may optionally include one or more storage devices physically located away from processor 510.
[0094] In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0095] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0096] The network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0097] In some embodiments, the AI-based graph data classification model training device provided in this application can be implemented in software. For example, it can be the graph data classification service on the server described above, or the graph data classification plugin on the terminal described above. Of course, it is not limited to this. The AI-based graph data classification device provided in this application can be provided in various software embodiments, including various forms such as applications, software, software modules, scripts, or code.
[0098] Figure 2 An AI-based graph data classification device 555, stored in memory 550, is shown. It can be software in the form of programs and plug-ins, such as graph data classification plug-ins, and includes a series of modules, including an acquisition module 5551, a sampling module 5552, a feature extraction module 5553, a training module 5554, and a prediction module 5555. These modules are logically connected and can therefore be arbitrarily combined or further split according to the functions they implement. The functions of each module will be described below.
[0099] As previously stated, the AI-based graph data classification model training method provided in this application can be implemented by various types of electronic devices. See also Figure 3 , Figure 3 This is a flowchart illustrating the training method for a graph data classification model based on artificial intelligence provided in this application embodiment, combined with... Figure 3 The steps shown are explained.
[0100] In the following steps, graph data can be data corresponding to compounds, such as the graph structure of proteins, where nodes represent molecules or atoms and edges represent bonds between molecules or atoms; graph data can also be data corresponding to social networks, such as the graph structure of a social network composed of multiple users, where nodes represent users and edges represent social relationships between users; graph data can also be financial market data for a certain period, such as a graph structure composed of multiple financial accounts, where nodes represent financial accounts and edges represent financial relationships between financial accounts.
[0101] In the following steps, the graph data classification model is a neural network model used for graph data classification, such as Graph Neural Networks (GNN), Convolutional Neural Networks (CNN), etc.
[0102] In step 101, the initial adjacency matrix corresponding to multiple edges in the graph data sample is obtained.
[0103] The initial adjacency matrix A includes the adjacency relationships between all nodes in the graph data sample, i.e., all edges in the graph data sample. The initial adjacency matrix A uses a two-dimensional array to store the edge data. The initial adjacency matrix A = { }, where N represents the number of nodes. For example, when there is a connection between node i and node j, i.e., there is an edge between node i and node j, then in the two-dimensional array... .
[0104] For example, before training a graph data classification model, the initial adjacency matrix of the graph data samples can be pre-stored in a database. During training, the initial adjacency matrix of the graph data samples can be retrieved from the database. Alternatively, during training, the adjacency relationships between all nodes in the graph data samples can be traversed. Based on these relationships, an initial adjacency matrix A is constructed; that is, when a connection is found between two nodes, the value corresponding to those two nodes in the initial adjacency matrix A is set to 1.
[0105] In step 102, the initial adjacency matrix corresponding to multiple edges is subjected to correlation sampling processing to obtain the sampled adjacency matrix.
[0106] For example, since graph data classification models learn node representations by aggregating information from neighboring nodes and the node itself, as the number of network layers in a graph data classification model increases, the node representations tend to converge, and the distinguishability of the node representations deteriorates. In other words, as the number of network layers continues to increase, the representations of all nodes will eventually converge to a fixed point, and the resulting node representations will become independent of the input features, and will also lead to gradient vanishing.
[0107] To address the aforementioned issues, we can perform correlated sampling on the initial adjacency matrix of the graph data edges to associate the output of the graph data classification model with the input, or reduce the number of edges in the graph data to avoid oversmoothing during model training.
[0108] See Figure 4 , Figure 4 This is a schematic diagram of an optional process for training a graph data classification model based on artificial intelligence, provided in an embodiment of this application. Figure 4Show Figure 3 Step 102 can also be implemented through step 1021: The graph data classification model includes multiple cascaded hidden layers; in step 1021, the initial adjacency matrix corresponding to multiple edges is subjected to correlation sampling processing through each hidden layer to obtain the sampling adjacency matrix corresponding to each hidden layer.
[0109] For example, by performing correlation sampling on the initial adjacency matrix based on the sampling parameters (i.e., the sampling probability with a dropout rate of p) in each hidden layer of the graph data classification model, the sampled adjacency matrix (i.e., the initial adjacency matrix after sampling) corresponding to each hidden layer is obtained. Subsequently, feature extraction is performed based on the sampled adjacency matrix corresponding to each hidden layer to obtain the graph data features of the graph data samples, thereby associating the graph data features with the input and avoiding the problem of oversmoothing during model training.
[0110] See Figure 5 , Figure 5 This is a schematic diagram of an optional process for training a graph data classification model based on artificial intelligence, provided in an embodiment of this application. Figure 5 Show Figure 4 Step 1021 can also be implemented through steps 10211A-10212A: In step 10211A, the sampling parameters corresponding to multiple edges are weighted by any hidden layer to obtain a set of weighted sampling parameters corresponding to each hidden layer; In step 10212A, the initial adjacency matrix is sampled based on the set of weighted sampling parameters corresponding to each hidden layer to obtain a sampled adjacency matrix corresponding to each hidden layer.
[0111] For example, first obtain the sampling parameters corresponding to each edge. The sampling parameters for each edge can be the same or different. To achieve associative sampling, based on the weights corresponding to multiple edges... (The weights of the edges between node i and node j) are sampled parameters for multiple edges through a hidden layer. The weighted sampling parameters are then processed to obtain the weighted sampling parameter set for each hidden layer (i.e., the weighted sampling parameters). The set of weighted sampling parameters for all hidden layers is the same. The sampling parameters are associated with weights, and the initial adjacency matrix is sampled based on the set of weighted sampling parameters for each hidden layer to obtain the sampling adjacency matrix for each hidden layer. The sampling adjacency matrix for each hidden layer is then associated with weights.
[0112] In some embodiments, the sampling parameters corresponding to multiple edges are weighted by any hidden layer to obtain a set of weighted sampling parameters for each hidden layer. This includes: performing similarity processing on the node features of two nodes corresponding to any edge by any hidden layer to obtain the similarity between the two nodes corresponding to any edge; determining the weight corresponding to any edge based on the similarity between the two nodes; weighting the sampling parameters corresponding to any edge based on the weight corresponding to any edge to obtain the weighted sampling parameters corresponding to any edge; and constructing a set of weighted sampling parameters for each hidden layer based on the set of weighted sampling parameters corresponding to multiple edges.
[0113] For example, each hidden layer performs similarity processing on the node features of two nodes corresponding to any side to obtain the similarity between the two nodes corresponding to any side. The similarity calculation can be a linear kernel function, a quadratic polynomial kernel function, a radial basis kernel function, etc. Based on the similarity between the two nodes, the weight corresponding to any side is determined. Based on the weight corresponding to any side, the sampling parameters corresponding to any side are weighted to obtain the weighted sampling parameters corresponding to any side. Then, the set of weighted sampling parameters corresponding to all sides constitutes the set of weighted sampling parameters corresponding to each hidden layer.
[0114] The weights are calculated as follows: the similarities between the two nodes corresponding to multiple edges are summed to obtain a sum. The ratio of the similarity between the two nodes corresponding to any edge to the sum is used as the weight of that edge. For example, This represents the node characteristics of node i in the initial adjacency matrix. This represents the node characteristics of node j in the initial adjacency matrix. Let represent the similarity between node i and node j in the initial adjacency matrix. Then, the weight of the edge between node i and node j is: ,in, This represents all the edges in the graph data sample.
[0115] See Figure 6 , Figure 6 This is a schematic diagram of an optional process for training a graph data classification model based on artificial intelligence, provided in an embodiment of this application. Figure 6 Show Figure 4 Step 1021 can also be implemented via step 10211-B: In step 10211B, through multiple cascaded hidden layers... l The hidden layer performs the following processing: based on the first... l -1 hidden layer and the first l The inter-layer dependencies of the hidden layer, for the first... l The sampling adjacency matrix corresponding to the -1 hidden layer is recursively sampled to obtain the -1 hidden layer. lThe sampling adjacency matrix corresponding to each hidden layer; where... l The numbers are increasing natural numbers and their values are in the range of 2 ≤ l ≤L, where L is the number of cascaded hidden layers. The sampling adjacency matrix corresponding to the first hidden layer is obtained by sampling the initial adjacency matrix based on the sampling parameters corresponding to multiple edges.
[0116] For example, in order to achieve associative sampling, the first step in the graph data classification model is to... l The hidden layer can be based on the first hidden layer. l -1 hidden layer and the first l The inter-layer dependencies of the hidden layer, for the first... l The sampling adjacency matrix corresponding to the -1 hidden layer is sampled to obtain the th hidden layer. l The sampling adjacency matrix corresponding to each hidden layer makes the sampling adjacency matrix interconnected layer by layer, avoiding the problem of over-smoothing during model training.
[0117] In some embodiments, when the first l The hidden layer and the first l When the inter-layer dependencies of the -1 hidden layer are increasing, recursive sampling is achieved in the following way: The initial adjacency matrix is compared with the ... l The sampling adjacency matrices corresponding to -1 hidden layers are interpolated to obtain the first interpolated adjacency matrix. The first interpolated adjacency matrix includes the first... l -1 unsampled edges in the hidden layer; based on the sampling parameters corresponding to multiple edges, the first difference adjacency matrix is sampled to obtain the sampled first difference adjacency matrix; the first... l The sampling adjacency matrix corresponding to the -1 hidden layer is summed with the sampling first difference adjacency matrix to obtain the -1 hidden layer. l The sampling adjacency matrix corresponding to each hidden layer.
[0118] For example, when the first l The hidden layer and the first l When the inter-layer dependencies of -1 hidden layers are increasing, the calculation formula for recursive sampling is: ,in, Indicates the first l -1 sampling adjacency matrix corresponding to hidden layers Sampling processing for Bernoulli distribution, This represents the adjacency matrix of the first difference sample. Indicates the first l The sampling adjacency matrix corresponding to each hidden layer. However, the embodiments of this application are not limited to... It can also be other variations of the formula.
[0119] In some embodiments, sampling the first difference adjacency matrix based on sampling parameters corresponding to multiple edges to obtain a sampled first difference adjacency matrix includes: weighting the sampling parameters corresponding to multiple edges to obtain a weighted sampling parameter set; and sampling the first difference adjacency matrix based on the weighted sampling parameter set to obtain a sampled first difference adjacency matrix.
[0120] For example, the weighted processing process is as follows: Similarity processing is performed on the node features of two nodes corresponding to any side through any hidden layer to obtain the similarity between the two nodes corresponding to any side; the similarities between two nodes corresponding to multiple sides are summed to obtain a summed result, and the ratio of the similarity between two nodes corresponding to any side to the summed result is used as the weight of any side; the sampling parameters corresponding to any side are weighted based on the weight of any side to obtain the weighted sampling parameters of any side; based on the set of weighted sampling parameters corresponding to multiple sides, a set of weighted sampling parameters corresponding to each hidden layer is constructed.
[0121] For example, the first difference adjacency matrix Sample the first difference adjacency matrix ),in, Indicates the Bernoulli distribution. Represents the first difference adjacency matrix The node characteristics of node i. Represents the first difference adjacency matrix The node characteristics of node j in the middle. Represents the first difference adjacency matrix The similarity between node i and node j. Represents the first difference adjacency matrix The weight of the edge between node i and node j. Represents the first difference adjacency matrix All edges in the array. However, the embodiments of this application are not limited to... The calculation formula can also be other variations of the formula.
[0122] In some embodiments, based on the first l -1 hidden layer and the first l The inter-layer dependencies of the hidden layer, for the first... l The sampling adjacency matrix corresponding to the -1 hidden layer is recursively sampled to obtain the -1 hidden layer. l The sampling adjacency matrix corresponding to the nth hidden layer includes: when the nth hidden layer... l The hidden layer and the first l When the inter-layer dependency of the -1 hidden layer is a decreasing relationship, the sampling parameters corresponding to multiple edges are used to evaluate the layer... lThe sampling adjacency matrix corresponding to the -1 hidden layer is sampled to obtain the second sampling adjacency matrix; the sampling adjacency matrix is then processed. l The sampled adjacency matrix corresponding to the -1 hidden layer is subtracted from the sampled second adjacency matrix, and the resulting sampled second difference adjacency matrix is used as the first... l The sampling adjacency matrix corresponding to each hidden layer.
[0123] For example, when the first l The hidden layer and the first l When the inter-layer dependencies of -1 hidden layers are decreasing, the calculation formula for recursive sampling is: ,in, Indicates the first l -1 sampling adjacency matrix corresponding to hidden layers, Sampling processing for Bernoulli distribution, This indicates sampling the second adjacency matrix. Indicates the first l The sampling adjacency matrix corresponding to each hidden layer. However, the embodiments of this application are not limited to... It can also be other variations of the formula.
[0124] In some embodiments, the sampling parameters corresponding to multiple edges are used to sample the first edge. l The sampling adjacency matrix corresponding to the -1 hidden layer is sampled to obtain the second sampling adjacency matrix, including: weighting the sampling parameters corresponding to multiple edges to obtain a weighted sampling parameter set; and applying the weighted sampling parameter set to the -1 hidden layer. l The sampling adjacency matrix corresponding to -1 hidden layer is sampled to obtain the second sampling adjacency matrix.
[0125] For example, the weighted processing process is as follows: Similarity processing is performed on the node features of two nodes corresponding to any side through any hidden layer to obtain the similarity between the two nodes corresponding to any side; the similarities between two nodes corresponding to multiple sides are summed to obtain a summed result, and the ratio of the similarity between two nodes corresponding to any side to the summed result is used as the weight of any side; the sampling parameters corresponding to any side are weighted based on the weight of any side to obtain the weighted sampling parameters of any side; based on the set of weighted sampling parameters corresponding to multiple sides, a set of weighted sampling parameters corresponding to each hidden layer is constructed.
[0126] For example, sampling the second adjacency matrix ),in, Indicates the Bernoulli distribution. express The node characteristics of node i. express The node characteristics of node j in the middle. express The similarity between node i and node j. express The weight of the edge between node i and node j. Indicates the sampling parameters. express All edges in the array. However, the embodiments of this application are not limited to... The calculation formula can also be other variations of the formula.
[0127] In step 103, feature extraction processing is performed on the graph data samples based on the sampling adjacency matrix to obtain the graph data features of the graph data samples.
[0128] For example, after sampling the initial adjacency matrix containing the edges of the graph data in a correlated manner, a sampled adjacency matrix is obtained. This matrix can be used to associate the output of the graph data classification model with the input, or to reduce the number of edges in the graph data. Based on the sampled adjacency matrix, feature extraction processing is performed on the graph data samples to obtain the graph data features of the graph data samples. The model is then trained using these graph data features to avoid the problem of oversmoothing during model training.
[0129] See Figure 4 , Figure 4 This is a schematic diagram of an optional process for training a graph data classification model based on artificial intelligence, provided in an embodiment of this application. Figure 4 Show Figure 3 Step 103 can also be implemented through step 1031: The graph data classification model includes multiple cascaded hidden layers; in step 1031, the graph data samples are subjected to cascaded feature extraction processing based on the sampling adjacency matrix corresponding to the multiple cascaded hidden layers to obtain the graph data features of the graph data samples.
[0130] like Figure 7 As shown, feature extraction is performed on graph data samples by combining the first hidden layer of multiple cascaded hidden layers with the sampling adjacency matrix corresponding to the first hidden layer. The feature extraction result of the first hidden layer is output to the subsequent cascaded hidden layers, so that feature extraction processing and feature extraction results can continue in the subsequent cascaded hidden layers until the last hidden layer is output. The feature extraction result output by the last hidden layer is used as the graph data feature of the graph data sample.
[0131] In some embodiments, feature extraction processing and feature extraction result output continue in subsequent cascaded hidden layers, including: through the first of multiple cascaded hidden layers... l The hidden layer performs the following processing: [The process is repeated in the original text.] l The sampling adjacency matrix corresponding to the nth hidden layer, the nth l The feature extraction results of the -1st hidden layer and the first... lThe learnable parameter matrices of the nth hidden layer are multiplied to obtain the nth... l The feature extraction results of the nth hidden layer, and the nth l The feature extraction results of the nth hidden layer are output to the nth... l +1 hidden layer; among which... l The numbers are increasing natural numbers and their values are in the range of 2 ≤ l ≤L-1, where L is the number of multiple cascaded hidden layers.
[0132] For example, the formula for feature extraction is: ,in, Indicates the first l The sampling adjacency matrix corresponding to each hidden layer Indicates the first l Feature extraction results from -1 hidden layer Indicates the first l The learnable parameter matrix of each hidden layer This refers to activation functions, such as ReLU, Sigmoid, and Tanh. Indicates the first l The feature extraction results of each hidden layer. However, the embodiments of this application are not limited to... The calculation formula can also be other variations of the formula.
[0133] In step 104, a graph data classification model is trained based on the graph data features of the graph data samples.
[0134] For example, a graph data classification model is used to predict the type of graph data samples based on their graph data features. The predicted type of the graph data samples is obtained. Based on the predicted type of the graph data samples and the type labels of the graph data samples, a loss function of the graph data classification model is constructed. The parameters of the graph data classification model are updated until the loss function converges. The updated parameters of the graph data classification model when the loss function converges are used as the parameters of the trained graph data classification model.
[0135] As an example, a loss function for a graph data classification model is constructed based on the predicted type of graph data samples and the type labels of the graph data samples. ,in, Indicates the type label of the graph data sample. This indicates the type of graph data sample prediction. The parameters of the graph data classification model are updated until the loss function converges. The parameters obtained when the loss function converges are used as the parameters of the trained graph data classification model.
[0136] Specifically, after determining the value of the loss function of the graph data classification model based on the predicted type of the graph data sample and the type label of the graph data sample, it can be determined whether the value of the loss function exceeds the preset threshold. When the value of the loss function exceeds the preset threshold, the error signal of the graph data classification model is determined based on the loss function, the error information is backpropagated in the graph data classification model, and the model parameters of each layer are updated during the propagation process.
[0137] Here, we explain backpropagation. Training sample data is input into the input layer of the neural network model, passes through the hidden layers, and finally reaches the output layer to output the result. This is the forward propagation process of the neural network model. Since there is an error between the output result of the neural network model and the actual result, the error between the output result and the actual value is calculated and backpropagated from the output layer to the hidden layers until it reaches the input layer. During the backpropagation process, the values of the model parameters are adjusted according to the error. That is, a loss function is constructed based on the error between the output result and the actual value, and the partial derivatives of the loss function with respect to the model parameters are calculated layer by layer to generate the gradient of the loss function with respect to the model parameters of each layer. Since the direction of the gradient indicates the direction of error amplification, the gradient of the model parameters is inverted and summed with the original parameters of each layer. The summation result is used as the updated model parameters of each layer, thereby reducing the error caused by the model parameters. The above process is iterated until convergence. Among them, the graph data classification model belongs to the neural network model.
[0138] In step 105, the trained graph data classification model is used to perform type prediction processing on the graph data to be classified, so as to obtain the type of the graph data to be classified.
[0139] As an example of obtaining graph data to be classified, after the user inputs the graph data to be classified into the input interface of the terminal, the terminal automatically obtains the classification request for the graph data to be classified, and based on the classification request, calls the graph data classification interface of the server. The trained graph data classification model is used to predict the type of the graph data to be classified, and obtains the type to which the graph data to be classified belongs. For example, the type of a compound to be classified (e.g., whether it is toxic, carcinogenic, hydrophilic, etc.), or whether there is risk in the financial market at a certain period, so as to realize the graph data classification function.
[0140] As previously stated, the AI-based graph data classification model training method provided in this application can be applied to various scenarios. See also... Figure 8 , Figure 8 This is a schematic diagram illustrating the application of the AI-based graph data classification model training method provided in this application to drug development. Figure 8 The steps shown are explained.
[0141] In the following steps, the graph data for the compounds refers to the data corresponding to the compounds, such as the graph structure of proteins. The nodes in the graph structure are the smallest elements, i.e., molecules or atoms, and the edges represent the bonds between molecules or between atoms. For example, ... Figure 9 The diagram shows the structure of an amino acid, with node 901 representing an amino molecule (COOH), node 902 representing a hydrogen atom (H), and edge 903 representing the bond between a hydrogen atom (H) and a carbon atom (C).
[0142] As an example of acquiring graph data for compounds to be classified, after the user inputs the compound to be classified into the terminal's input interface, the terminal automatically parses the structure of the compound to be classified, generates graph data of the compound to be classified, and automatically obtains a classification request for the compound to be classified. Based on the classification request, the terminal calls the server's graph data classification interface, uses a trained graph data classification model to predict the type of the graph data of the compound to be classified, and obtains the type to which the compound belongs. For example, the type to which a compound to be classified belongs (e.g., whether it is toxic, whether it is anti-cancer, whether it is hydrophilic, etc.). If it is determined that the type of the compound to be classified belongs to anti-cancer, then subsequent anti-cancer research can be carried out based on the compound to be classified, laying the foundation for anti-cancer engineering.
[0143] In step 201, the initial adjacency matrix corresponding to multiple connection bonds in the graph data sample of the compound sample is obtained.
[0144] The initial adjacency matrix A includes the adjacency relationships between all elements (i.e., element units) in the graph data sample of the compound sample, that is, all connection bonds in the graph data sample of the compound sample. The initial adjacency matrix A uses a two-dimensional array to store the connection bond data. The initial adjacency matrix A = { }, where N represents the number of elements. For example, when there is a connection between element i and element j, that is, when there is a connection key between element i and element j, then in the two-dimensional array... .
[0145] In step 202, the initial adjacency matrices corresponding to multiple connection keys are subjected to correlation sampling processing to obtain the sampled adjacency matrix.
[0146] For example, since graph data classification models learn element representations by aggregating information from neighboring elements (elements) and the elements themselves, as the number of network layers in a graph data classification model increases, the element representations tend to converge, and the distinguishability of the element representations deteriorates. In other words, as the number of network layers continues to increase, the representations of all elements will eventually converge to a fixed point, and the resulting element representations will be independent of the input features, and will also lead to gradient vanishing.
[0147] To address the aforementioned issues, one approach is to perform correlated sampling on the initial adjacency matrix, which includes the connection keys of the graph data, to associate the output of the graph data classification model with its input. Alternatively, one approach is to reduce the number of connection keys in the graph data to avoid oversmoothing during model training.
[0148] In some embodiments, the graph data classification model includes multiple cascaded hidden layers; each hidden layer performs associative sampling processing on the initial adjacency matrices corresponding to multiple connection keys to obtain the sampled adjacency matrix corresponding to each hidden layer.
[0149] For example, by performing correlation sampling on the initial adjacency matrix based on the sampling parameters (i.e., the sampling probability with a dropout rate of p) in each hidden layer of the graph data classification model, the sampled adjacency matrix (i.e., the initial adjacency matrix after sampling) corresponding to each hidden layer is obtained. Subsequently, feature extraction processing is performed based on the sampled adjacency matrix corresponding to each hidden layer to obtain the graph data features of the compound sample graph data sample, thereby associating the graph data features with the input and avoiding the problem of oversmoothing during model training.
[0150] In some embodiments, the associative sampling processing of the initial adjacency matrices corresponding to multiple connection keys is performed through any hidden layer to obtain the sampled adjacency matrix corresponding to each hidden layer, including: weighting the sampling parameters corresponding to the multiple connection keys through any hidden layer to obtain the weighted sampling parameter set corresponding to each hidden layer; and sampling the initial adjacency matrix based on the weighted sampling parameter set corresponding to each hidden layer to obtain the sampled adjacency matrix corresponding to each hidden layer.
[0151] For example, first obtain the sampling parameters corresponding to each connection key. The sampling parameters corresponding to each connection key can be the same or different. To achieve associative sampling, the sampling parameters corresponding to multiple connection keys can be weighted in each hidden layer to obtain a weighted sampling parameter set for each hidden layer (i.e., the set of weighted sampling parameters). Then, the sampling parameters are associated through weights. Based on the weighted sampling parameter set corresponding to each hidden layer, the initial adjacency matrix is sampled to obtain the sampling adjacency matrix corresponding to each hidden layer. Finally, the sampling adjacency matrix corresponding to each hidden layer is associated through weights.
[0152] In some embodiments, the sampling parameters corresponding to multiple join keys are weighted by any hidden layer to obtain a set of weighted sampling parameters for each hidden layer. This includes: performing similarity processing on the element features of two elements corresponding to any join key by each hidden layer to obtain the similarity between the two elements corresponding to any join key; determining the weight corresponding to any join key based on the similarity between the two elements; weighting the sampling parameters corresponding to any join key based on the weight corresponding to any join key to obtain a set of weighted sampling parameters corresponding to any join key; and constructing a set of weighted sampling parameters for each hidden layer based on the set of weighted sampling parameters corresponding to multiple join keys.
[0153] The weights are calculated as follows: The similarities between the two elements corresponding to multiple join keys are summed to obtain the sum. The ratio of the similarity between the two elements corresponding to any join key to the sum is used as the weight of that join key. For example, Let i represent the element characteristics of element i in the initial adjacency matrix. Let represent the element characteristics of element j in the initial adjacency matrix. Let represent the similarity between element i and element j in the initial adjacency matrix. Then, the weight corresponding to the connection key between element i and element j is: ,in, This represents all the connection bonds in the graph data sample. Elemental characteristics can include features used to characterize elements, such as proton number, charge number, or element ordinal number.
[0154] In some embodiments, each hidden layer performs associative sampling processing on the initial adjacency matrices corresponding to multiple connection keys to obtain a sampled adjacency matrix corresponding to each hidden layer, including: through the first of multiple cascaded hidden layers... l The hidden layer performs the following processing: based on the first... l -1 hidden layer and the first l The inter-layer dependencies of the hidden layer, for the first... l The sampling adjacency matrix corresponding to the -1 hidden layer is recursively sampled to obtain the -1 hidden layer. l The sampling adjacency matrix corresponding to each hidden layer; where... l The numbers are increasing natural numbers and their values are in the range of 2 ≤ l ≤L, where L is the number of cascaded hidden layers. The sampling adjacency matrix corresponding to the first hidden layer is obtained by sampling the initial adjacency matrix based on the sampling parameters corresponding to the multiple connection keys.
[0155] In some embodiments, when the first l The hidden layer and the first l When the inter-layer dependencies of the -1 hidden layer are increasing, recursive sampling is achieved in the following way: The initial adjacency matrix is compared with the ...l The sampling adjacency matrix corresponding to the -1 hidden layer is interpolated to obtain the first interpolated adjacency matrix. The first interpolated adjacency matrix includes the sampling adjacency matrix of the -1 hidden layer. l -1 unsampled connection keys in the hidden layer; sample the first difference adjacency matrix based on the sampling parameters corresponding to multiple connection keys to obtain the sampled first difference adjacency matrix; then... l The sampling adjacency matrix corresponding to the -1 hidden layer is summed with the sampling first difference adjacency matrix to obtain the -1 hidden layer. l The sampling adjacency matrix corresponding to each hidden layer.
[0156] For example, when the first l The hidden layer and the first l When the inter-layer dependencies of -1 hidden layers are increasing, the calculation formula for recursive sampling is: ,in, Indicates the first l -1 sampling adjacency matrix corresponding to hidden layers, Sampling processing for Bernoulli distribution, This represents the adjacency matrix of the first difference sample. Indicates the first l The sampling adjacency matrix corresponding to each hidden layer. However, the embodiments of this application are not limited to... It can also be other variations of the formula.
[0157] In some embodiments, sampling the first difference adjacency matrix based on sampling parameters corresponding to multiple connection keys to obtain a sampled first difference adjacency matrix includes: weighting the sampling parameters corresponding to multiple connection keys to obtain a weighted sampling parameter set; and sampling the first difference adjacency matrix based on the weighted sampling parameter set to obtain a sampled first difference adjacency matrix.
[0158] For example, the weighted processing procedure is as follows: The similarity of element features between two elements corresponding to any connection key is processed by each hidden layer to obtain the similarity between the two elements corresponding to any connection key; the similarities between two elements corresponding to multiple connection keys are summed to obtain a summed result, and the ratio of the similarity between two elements corresponding to any connection key to the summed result is used as the weight of any connection key; the sampling parameters corresponding to any connection key are weighted based on the weight of any connection key to obtain the weighted sampling parameters of any connection key; and the set of weighted sampling parameters corresponding to multiple connection keys is used to construct the set of weighted sampling parameters for each hidden layer.
[0159] For example, the first difference adjacency matrix Sample the first difference adjacency matrix ),in, Indicates the Bernoulli distribution. Represents the first difference adjacency matrix The elemental characteristics of element i. Represents the first difference adjacency matrix The elemental characteristics of element j in the middle. Represents the first difference adjacency matrix The similarity between element i and element j. Represents the first difference adjacency matrix The weight corresponding to the connection key between element i and element j. Represents the first difference adjacency matrix All connection keys in the file. However, the embodiments of this application are not limited to... The calculation formula can also be other variations of the formula.
[0160] In some embodiments, based on the first l -1 hidden layer and the first l The inter-layer dependencies of the hidden layer, for the first... l The sampling adjacency matrix corresponding to the -1 hidden layer is recursively sampled to obtain the -1 hidden layer. l The sampling adjacency matrix corresponding to the nth hidden layer includes: when the nth hidden layer... l The hidden layer and the first l When the inter-layer dependency of the -1 hidden layer is a decreasing relationship, the sampling parameters corresponding to multiple connection keys are used to evaluate the layer of the -1 hidden layer. l The sampling adjacency matrix corresponding to the -1 hidden layer is sampled to obtain the second sampling adjacency matrix; the sampling adjacency matrix is then processed. l The sampled adjacency matrix corresponding to the -1 hidden layer is subtracted from the sampled second adjacency matrix, and the resulting sampled second difference adjacency matrix is used as the first... l The sampling adjacency matrix corresponding to each hidden layer.
[0161] For example, when the first l The hidden layer and the first l When the inter-layer dependencies of -1 hidden layers are decreasing, the calculation formula for recursive sampling is: ,in, Indicates the first l -1 sampling adjacency matrix corresponding to hidden layers Sampling processing for Bernoulli distribution, This indicates sampling the second adjacency matrix. Indicates the first l The sampling adjacency matrix corresponding to each hidden layer. However, the embodiments of this application are not limited to... It can also be other variations of the formula.
[0162] In some embodiments, the sampling parameters corresponding to the multiple connection keys are used to sample the first...l The sampling adjacency matrix corresponding to the -1 hidden layer is sampled to obtain the second sampling adjacency matrix, including: weighting the sampling parameters corresponding to multiple connection keys to obtain a weighted sampling parameter set; and applying the weighted sampling parameter set to the -1 hidden layer. l The sampling adjacency matrix corresponding to -1 hidden layer is sampled to obtain the second sampling adjacency matrix.
[0163] For example, the weighted processing procedure is as follows: The similarity of element features between two elements corresponding to any connection key is processed by each hidden layer to obtain the similarity between the two elements corresponding to any connection key; the similarities between two elements corresponding to multiple connection keys are summed to obtain a summed result, and the ratio of the similarity between two elements corresponding to any connection key to the summed result is used as the weight of any connection key; the sampling parameters corresponding to any connection key are weighted based on the weight of any connection key to obtain the weighted sampling parameters of any connection key; and the set of weighted sampling parameters corresponding to multiple connection keys is used to construct the set of weighted sampling parameters for each hidden layer.
[0164] For example, sampling the second adjacency matrix ),in, Indicates the Bernoulli distribution. express The elemental characteristics of element i. express The elemental characteristics of element j in the middle. express The similarity between element i and element j. express The weight corresponding to the connection key between element i and element j. express All connection keys in the file. However, the embodiments of this application are not limited to... The calculation formula can also be other variations of the formula.
[0165] In step 203, feature extraction processing is performed on the graph data samples of the compound samples based on the sampling adjacency matrix to obtain the graph data features of the compound samples.
[0166] For example, a graph data classification model includes multiple cascaded hidden layers. Based on the sampling adjacency matrices corresponding to these cascaded hidden layers, cascaded feature extraction is performed on the graph data samples to obtain the graph data features of the compound samples. These graph data features include elemental features and bond features. Specifically, feature extraction is performed on the graph data samples using the first hidden layer and its corresponding sampling adjacency matrix. The feature extraction result of the first hidden layer is then output to subsequent cascaded hidden layers, allowing for continued feature extraction and result output until the last hidden layer. The feature extraction result from the last hidden layer is then used as the graph data feature of the graph data sample.
[0167] In some embodiments, feature extraction processing and feature extraction result output continue in subsequent cascaded hidden layers, including: through the first of multiple cascaded hidden layers... l The hidden layer performs the following processing: [The process is repeated in the original text.] l The sampling adjacency matrix corresponding to the nth hidden layer, the nth l The feature extraction results of the -1st hidden layer and the first... l The learnable parameter matrices of the nth hidden layer are multiplied to obtain the nth... l The feature extraction results of the nth hidden layer, and the nth l The feature extraction results of the nth hidden layer are output to the nth... l +1 hidden layer; among which... l The numbers are increasing natural numbers and their values are in the range of 2 ≤ l ≤L-1, where L is the number of multiple cascaded hidden layers.
[0168] For example, the formula for feature extraction is: ,in, Indicates the first l The sampling adjacency matrix corresponding to each hidden layer Indicates the first l Feature extraction results from -1 hidden layer Indicates the first l The learnable parameter matrix of each hidden layer This refers to activation functions, such as ReLU, Sigmoid, and Tanh. Indicates the first l The feature extraction results of each hidden layer. However, the embodiments of this application are not limited to... The calculation formula can also be other variations of the formula.
[0169] In step 204, a graph data classification model is trained based on the graph data features of the compound samples.
[0170] For example, a graph data classification model can be used to predict the type of a compound sample based on its graph data features. This results in the predicted type of the compound sample (e.g., whether it is toxic, whether it can cure cancer, whether it is hydrophilic, etc.). Based on the predicted type of the compound sample and its type label, a cross-entropy loss function for the graph data classification model can be constructed. The parameters of the graph data classification model can be updated until the loss function converges. The updated parameters of the graph data classification model when the loss function converges are used as the parameters of the trained graph data classification model.
[0171] Taking the application of graph data classification models for cancer treatment classification as an example, the graph data classification model is used to perform type prediction processing on the graph data features of compound samples to determine the predicted cancer treatment type of the compound sample, such as cervical cancer, gastric cancer, rectal cancer, etc. Based on the predicted cancer treatment type of the compound sample and the cancer treatment label of the compound sample, the graph data classification model is trained so that the trained graph data classification model can accurately predict the cancer type of the compound.
[0172] In step 205, the trained graph data classification model is used to perform type prediction processing on the graph data of the compounds to be classified, so as to obtain the type to which the compounds belong.
[0173] For example, by using a trained graph data classification model to predict the type of the compound to be classified from the graph data, the cancer treatment type of the compound can be obtained. For instance, if a compound to be classified belongs to the type for treating gastric cancer, drug developers can conduct research on gastric cancer drugs based on this compound, and develop new gastric cancer drugs that can be applied clinically. This also allows drug developers to quickly obtain drug molecules with positive effects on cancer based on this compound, and conduct subsequent valuable anti-cancer research, laying the foundation for anti-cancer engineering.
[0174] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0175] Although DropEdge can facilitate the training of deep GCN-type models, its sampling distribution is very simple, so the facilitation effect is limited.
[0176] To address the aforementioned issues, this application proposes a graph data classification model training method based on DropEdge, namely DropEdge++. DropEdge++ can include two sampling algorithms. First, an edge-biased sampler applies a kernel function based on the features of the two points connected by an edge, using the resulting weights as sampling weights. This can correlate the network's output with its input as the number of layers increases, thus mitigating oversmoothing. Second, a layer-dependent sampler gradually increases or decreases the number of edges sampled from the input layer to the output layer through inter-layer dependent sampling, thereby reducing the mean number of edges (MEN) and also playing a positive role in mitigating oversmoothing. Both sampling methods perform correlated sampling to alleviate the oversmoothing problem. DropEdge++ combines these two sampling algorithms to further alleviate the oversmoothing problem in graph neural networks.
[0177] The AI-based graph data method proposed in this application is a sampling algorithm that can be paired with various GCN-type models for end-to-end training, thereby improving the performance of deep graph models. This method can be applied in practical application scenarios such as drug development and social relationship analysis to enhance the performance of existing models.
[0178] Below, we will first introduce graph convolutional neural networks and the DropEdge method:
[0179] Define a graph as ,in, Represents a set of nodes. Denotes the set of edges. Define the topological relationships in the graph. Let A denote the adjacency matrix of the graph, if... , If there is an edge, then ;if , If there is no such relationship, then... . This represents the characteristic information of nodes in a graph. For example, in a social network, each user, as a node, possesses certain characteristics, such as age, login location, and usage preferences. In a molecular structure network, each atom, as a node, also possesses certain characteristics, such as the number of protons, the number of charges, and the elemental ordinal number.
[0180] Regarding graph convolutional neural networks: The operations of a single-layer graph convolutional neural network on a graph are shown in formula (1):
[0181] (1)
[0182] in, This represents the first convolutional neural network. The features of the layer, the input layer features are ,in . Let D be the regularized adjacency matrix, and D be the degree matrix, where the diagonal represents the degree of the corresponding node (i.e., the sum of the weights of the edges connected to the node). This is the parameter matrix of the model. For example, activation functions .
[0183] Graph convolutional neural networks can be stacked in multiple layers to form deep graph convolutional neural network models. For example, the graph operations of a two-layer graph convolutional neural network are shown in formula (2):
[0184] (2)
[0185] in, For the network output, For the number of nodes, For output dimensions, and These are the parameters for the first and second layers, respectively.
[0186] DropEdge performs a check on the adjacency matrix in each training epoch. The edges in the sample are sampled, and the distribution of the samples is shown in formula (3):
[0187] (3)
[0188] That is, each edge is independently sampled from a Bernoulli distribution with a drop rate of p.
[0189] DropEdge can slow down oversmoothing or reduce information loss, thereby improving the performance of deep models.
[0190] Based on DropEdge, this application proposes two sampling algorithms:
[0191] 1. Edge-biased sampler (EB)
[0192] In an edge-biased sampler, edges are sampled based on different weights. These weights are directly related to the feature similarity between the two nodes connected by the edge; the more similar the features, the higher the sampling probability. A kernel function, denoted by K, is introduced to characterize the similarity. K(x,x') takes the features of two points as input, and a larger returned value indicates a higher degree of similarity. For example, a linear kernel function K(x,x') = xT x' is the Euclidean inner product. Thus, the discarded edges are sampled according to the distribution of the following formula (4), where p is also the global sampling rate coefficient (sampling parameter) for discarded edges.
[0193] (4)
[0194] Edge-biased samplers can also slow down oversmoothing or reduce information loss, and can always associate the output of deep networks with the input. The subspace that the model training converges to always contains some information associated with the node features of the input.
[0195] 2. Layer-dependent sampler (LD)
[0196] Layer-dependent sampler sampling has three sampling methods: no inter-layer dependency (LI), increasing inter-layer dependency sampling (LID), and decreasing inter-layer dependency sampling (LDD). Among them, LID is the optimal inter-layer dependency sampling, and it is based on the average number of edges MEN. This means that the MEN of LID must be strictly less than or equal to the MEN of LDD. The MEN is defined as shown in formula (5):
[0197] (5)
[0198] The NNZ (Number of nonzero matrix elements) function represents the number of nonzero elements in the matrix.
[0199] The following sections introduce inter-layer dependency incremental sampling (LID) and inter-layer dependency decrement sampling (LDD):
[0200] (1) LID (Layer-increasingly-dependent)
[0201] The convolutional neural network samples recursively layer by layer (from the input layer to the output layer, i.e., from the first layer to the last layer), as shown in Equation (6):
[0202] (6)
[0203] Ultimately there are .
[0204] (2) LDD (Layer-decreasingly-dependent)
[0205] The convolutional neural network samples recursively layer by layer (from the output layer to the input layer, i.e., from the last layer to the first layer), as shown in Equation (7):
[0206] (7)
[0207] Ultimately there are .
[0208] Alternatively, the convolutional neural network can sample recursively layer by layer (from the input layer to the output layer, i.e., from the first layer to the last layer), as shown in Equation (8):
[0209] (8)
[0210] For ease of analysis, the sampling rate of layer-by-layer sampling is controlled to increase linearly (LID) or decrease linearly (LDD). Two parameters, pmax and pmin, are introduced here to control the maximum and minimum sampling rates, respectively.
[0211] To experimentally observe the close relationship between MEN and oversmoothing, this application provides a graph of the training loss, validation loss, and MEN of a 6-layer GCN on the Cora dataset, as shown below. Figures 10-12 As shown in the figure, four methods—DropEdge, LID, LDD, and LI—are compared. Among them, LID achieves the minimum training loss and validation loss, and also the minimum MEN. The losses of the other methods on the training and validation sets are directly related to the MEN value.
[0212] Finally, this application embodiment combines the EB sampling algorithm and the LID sampling algorithm to obtain the DropEdge++ sampling algorithm. DropEdge++ is based on LID and performs weighted sampling from the remaining unsampled edges in the previous layer according to the distribution of EB when adding edges in each layer.
[0213] like Figures 13-14 As shown in the embodiments of this application, the performance of DropEdge, EB and DropEdge++ was analyzed on a 6-layer GCN. Among them, DropEdge++ achieved the lowest training loss and validation loss among the three, and has a good training effect.
[0214] like Figure 15 As shown in the embodiments of this application, the performance impact of different kernel functions (linear kernel function (EB-linear), quadratic polynomial kernel function (EB-poly), DropEdge sampling, and radial basis function (EB-RBF)) on EB sampling is analyzed. Among them, the linear kernel function (EB-linear) and the quadratic polynomial kernel function (EB-poly) have better performance and are excellent choices for potential kernel functions.
[0215] In summary, the AI-based graph data classification model training method provided in this application has the following beneficial effects:
[0216] 1) This application proposes an edge sampling method that can improve the performance of deep neural networks. It can effectively mitigate the negative impact of oversmoothing on GCN and its related variant models, thereby better training the model and obtaining higher quality feature embeddings.
[0217] 2) The embodiments of this application are very convenient to use. Under various GCN type model architectures, the DropEdge++ algorithm can be called layer by layer without modifying the original framework.
[0218] 3) The embodiments of this application have broad application prospects and can be applied to supervised node classification tasks. Moreover, they can obtain higher quality node feature embeddings, achieve feature dimensionality reduction, and thus connect with downstream tasks.
[0219] This concludes the description of the AI-based graph data classification model training method provided in this application, using exemplary applications and implementations of the electronic devices provided in the embodiments of this application. This application also provides a graph data classification model training apparatus. In practical applications, the functional modules in the graph data classification model training apparatus can be collaboratively implemented using the hardware resources of the electronic device (such as a terminal device, server, or server cluster), such as computing resources like processors, communication resources (such as those supporting various communication methods like optical fiber and cellular), and memory. Figure 2 The diagram illustrates a graph data classification model training device 555 stored in memory 550. This device can be software in the form of programs and plugins, such as software modules designed in programming languages like C / C++ and Java, application software designed in C / C++ and Java, dedicated software modules within large software systems, application programming interfaces (APIs), plugins, cloud services, etc. Exemplary implementations include: the graph data classification model training device being a mobile application and module; the graph data classification model training device being a server application and platform; the graph data classification model training device being a server-side application programming interface (API) and plugins; Example 4: the graph data classification model training device being a mobile device client API and plugins; the graph data classification model training device being a cloud-based open service.
[0220] The graph data classification model training device 555 includes a series of modules, including an acquisition module 5551, a sampling module 5552, a feature extraction module 5553, a training module 5554, and a prediction module 5555. The following describes the scheme for the cooperation of the various modules in the graph data classification model training device 555 provided in this embodiment to achieve graph data classification model training.
[0221] The acquisition module 5551 is used to acquire the initial adjacency matrix corresponding to multiple edges in the graph data sample; the sampling module 5552 is used to perform correlation sampling processing on the initial adjacency matrix corresponding to the multiple edges to obtain the sampled adjacency matrix; the feature extraction module 5553 is used to perform feature extraction processing on the graph data sample based on the sampled adjacency matrix to obtain the graph data features of the graph data sample; the training module 5554 is used to train a graph data classification model based on the graph data features of the graph data sample; and the prediction module 5555 is used to perform type prediction processing on the graph data to be classified through the trained graph data classification model to obtain the type to which the graph data to be classified belongs.
[0222] In some embodiments, the graph data classification model includes multiple cascaded hidden layers; the sampling module 5552 is further configured to perform correlation sampling processing on the initial adjacency matrices corresponding to the multiple edges through each hidden layer to obtain a sampling adjacency matrix corresponding to each hidden layer; the feature extraction module 5553 is further configured to perform cascaded feature extraction processing on the graph data samples based on the sampling adjacency matrices corresponding to the multiple cascaded hidden layers to obtain the graph data features of the graph data samples.
[0223] In some embodiments, the sampling module 5552 is further configured to perform weighted processing on the sampling parameters corresponding to the plurality of edges through any of the hidden layers to obtain a set of weighted sampling parameters corresponding to each hidden layer; and to perform sampling processing on the initial adjacency matrix based on the set of weighted sampling parameters corresponding to each hidden layer to obtain a sampled adjacency matrix corresponding to each hidden layer.
[0224] In some embodiments, the sampling module 5552 is further configured to perform similarity processing on the node features of two nodes corresponding to any edge through each hidden layer to obtain the similarity between the two nodes corresponding to any edge; determine the weight corresponding to any edge based on the similarity between the two nodes; perform weighted processing on the sampling parameters corresponding to any edge based on the weight corresponding to any edge to obtain the weighted sampling parameters corresponding to any edge; and construct a set of weighted sampling parameters corresponding to each hidden layer based on a set including a plurality of weighted sampling parameters corresponding to multiple edges.
[0225] In some embodiments, the sampling module 5552 is further configured to sum the similarities between two nodes corresponding to multiple edges to obtain a summing result; and to use the ratio of the similarity between two nodes corresponding to any edge to the summing result as the weight of any edge.
[0226] In some embodiments, the sampling module 5552 is further configured to perform the following processing through the j-th hidden layer of the plurality of cascaded hidden layers: recursively sampling the sampling adjacency matrix corresponding to the (j-1)-th hidden layer to obtain the sampling adjacency matrix corresponding to the j-th hidden layer; wherein, j is an increasing natural number and its value range is 2≤j≤N, N is the number of the plurality of cascaded hidden layers, and the sampling adjacency matrix corresponding to the first hidden layer is obtained by sampling the initial adjacency matrix based on the sampling parameters corresponding to the plurality of edges respectively.
[0227] In some embodiments, the sampling module 5552 is further configured to perform difference processing on the initial adjacency matrix and the sampled adjacency matrix corresponding to the (j-1)th hidden layer to obtain a first difference adjacency matrix, wherein the first difference adjacency matrix includes the unsampled edges in the (j-1)th hidden layer; perform sampling processing on the first difference adjacency matrix based on the sampling parameters corresponding to the plurality of edges respectively to obtain a sampled first difference adjacency matrix; and sum the sampled adjacency matrix corresponding to the (j-1)th hidden layer and the sampled first difference adjacency matrix to obtain the sampled adjacency matrix corresponding to the j-th hidden layer.
[0228] In some embodiments, the sampling module 5552 is further configured to perform weighted processing on the sampling parameters corresponding to the plurality of edges respectively to obtain a weighted sampling parameter set; and to perform sampling processing on the first difference adjacency matrix based on the weighted sampling parameter set to obtain a sampled first difference adjacency matrix.
[0229] In some embodiments, the sampling module 5552 is further configured to perform sampling processing on the sampling adjacency matrix corresponding to the (j-1)th hidden layer based on the sampling parameters corresponding to the plurality of edges respectively, to obtain a second sampling adjacency matrix; perform difference processing on the sampling adjacency matrix corresponding to the (j-1)th hidden layer and the second sampling adjacency matrix, and use the obtained second sampling difference adjacency matrix as the sampling adjacency matrix corresponding to the j-th hidden layer.
[0230] In some embodiments, the sampling module 5552 is further configured to perform weighted processing on the sampling parameters corresponding to the plurality of edges respectively to obtain a weighted sampling parameter set; and to perform sampling processing on the sampling adjacency matrix corresponding to the (j-1)th hidden layer based on the weighted sampling parameter set to obtain the second sampling adjacency matrix.
[0231] In some embodiments, the sampling module 5552 is further configured to perform feature extraction processing on the graph data sample by combining the first hidden layer of the plurality of cascaded hidden layers with the sampling adjacency matrix corresponding to the first hidden layer; output the feature extraction result of the first hidden layer to the subsequent cascaded hidden layers, so as to continue feature extraction processing and feature extraction result output in the subsequent cascaded hidden layers, until the last hidden layer is output; and use the feature extraction result output by the last hidden layer as the graph data feature of the graph data sample.
[0232] In some embodiments, the sampling module 5552 is further configured to perform the following processing through the i-th hidden layer of the plurality of cascaded hidden layers: multiply the sampling adjacency matrix corresponding to the i-th hidden layer, the feature extraction result of the (i-1)-th hidden layer, and the learnable parameter matrix of the i-th hidden layer to obtain the feature extraction result of the i-th hidden layer, and output the feature extraction result of the i-th hidden layer to the (i+1)-th hidden layer; where i is an increasing natural number and its value range is 2≤i≤N-1, and N is the number of the plurality of cascaded hidden layers.
[0233] In some embodiments, the training module 5554 is further configured to perform type prediction processing on the graph data features of the graph data sample using the graph data classification model to obtain the predicted type of the graph data sample; construct the loss function of the graph data classification model based on the predicted type of the graph data sample and the type label of the graph data sample; update the parameters of the graph data classification model until the loss function converges, and use the updated parameters of the graph data classification model when the loss function converges as the parameters of the trained graph data classification model.
[0234] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the artificial intelligence-based graph data classification model training method described above in this application.
[0235] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to execute the AI-based graph data classification model training method provided in this application. For example... Figure 3-6 The training method for graph data classification models based on artificial intelligence is shown.
[0236] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0237] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0238] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0239] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0240] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A method for training a graph data classification model, characterized in that, The graph data classification model includes multiple cascaded hidden layers, and the method includes: Obtain the initial adjacency matrix corresponding to multiple edges in the graph data sample of the compound sample. The graph data sample is the graph structure of the compound sample. The nodes in the graph structure are molecules or atoms, and the edges in the graph structure represent the connecting bonds between molecules or the connecting bonds between atoms. By performing associative sampling processing on the initial adjacency matrix corresponding to the plurality of edges in each hidden layer, a sampled adjacency matrix corresponding to each hidden layer is obtained; Based on the sampling adjacency matrix corresponding to the multiple cascaded hidden layers, cascaded feature extraction processing is performed on the graph data samples of the compound samples to obtain the graph data features of the graph data samples of the compound samples. A graph data classification model is trained based on the graph data features of the compound samples. The trained graph data classification model is used to perform type prediction processing on the graph data of the compound to be classified, so as to obtain the type to which the graph data of the compound to be classified belongs.
2. The method according to claim 1, characterized in that, The step of performing correlation sampling processing on the initial adjacency matrix corresponding to the plurality of edges through each hidden layer to obtain the sampled adjacency matrix corresponding to each hidden layer includes: By weighting the sampling parameters corresponding to the plurality of edges through any of the hidden layers, a set of weighted sampling parameters corresponding to each hidden layer is obtained; The initial adjacency matrix is sampled based on the weighted sampling parameter set corresponding to each hidden layer to obtain the sampled adjacency matrix corresponding to each hidden layer.
3. The method according to claim 2, characterized in that, The step of weighting the sampling parameters corresponding to the plurality of edges through any of the hidden layers to obtain a set of weighted sampling parameters corresponding to each hidden layer includes: By performing similarity processing on the node features of the two nodes corresponding to any one of the hidden layers, the similarity between the two nodes corresponding to any one of the edges can be obtained. Based on the similarity between the two nodes, determine the weight corresponding to any of the edges; The sampling parameters corresponding to any one of the edges are weighted based on the weights corresponding to any one of the edges to obtain the weighted sampling parameters corresponding to any one of the edges. A set of weighted sampling parameters corresponding to each of the hidden layers is formed based on a set of weighted sampling parameters corresponding to multiple edges.
4. The method according to claim 3, characterized in that, Determining the weight of any edge based on the similarity between the two nodes includes: The similarity between the two nodes corresponding to the multiple edges is summed to obtain the summation result; The ratio of the similarity between the two nodes corresponding to any edge to the summation result is used as the weight of any edge.
5. The method according to claim 1, characterized in that, The step of performing correlation sampling processing on the initial adjacency matrix corresponding to the plurality of edges through each hidden layer to obtain the sampled adjacency matrix corresponding to each hidden layer includes: The following processing is performed through the j-th hidden layer of the multiple cascaded hidden layers: The sampling adjacency matrix corresponding to the (j-1)th hidden layer is recursively sampled to obtain the sampling adjacency matrix corresponding to the j-th hidden layer. Where j is an increasing natural number with a value range of 2≤j≤N, N is the number of the multiple cascaded hidden layers, and the sampling adjacency matrix corresponding to the first hidden layer is obtained by sampling the initial adjacency matrix based on the sampling parameters corresponding to the multiple edges.
6. The method according to claim 5, characterized in that, The recursive sampling process of the sampling adjacency matrix corresponding to the (j-1)th hidden layer to obtain the sampling adjacency matrix corresponding to the j-th hidden layer includes: The initial adjacency matrix is compared with the sampled adjacency matrix corresponding to the (j-1)th hidden layer to obtain a first difference adjacency matrix, which includes the unsampled edges in the (j-1)th hidden layer. The first difference adjacency matrix is sampled based on the sampling parameters corresponding to the multiple edges to obtain the sampled first difference adjacency matrix. The sampling adjacency matrix corresponding to the (j-1)th hidden layer is summed with the sampling first difference adjacency matrix to obtain the sampling adjacency matrix corresponding to the jth hidden layer.
7. The method according to claim 6, characterized in that, The step of sampling the first difference adjacency matrix based on the sampling parameters corresponding to the plurality of edges to obtain a sampled first difference adjacency matrix includes: The sampling parameters corresponding to the multiple edges are weighted to obtain a weighted sampling parameter set. The first difference adjacency matrix is sampled based on the weighted sampling parameter set to obtain the sampled first difference adjacency matrix.
8. The method according to claim 5, characterized in that, The recursive sampling process of the sampling adjacency matrix corresponding to the (j-1)th hidden layer to obtain the sampling adjacency matrix corresponding to the j-th hidden layer includes: Based on the sampling parameters corresponding to the multiple edges, the sampling adjacency matrix corresponding to the (j-1)th hidden layer is sampled to obtain the second sampling adjacency matrix; The sampling adjacency matrix corresponding to the (j-1)th hidden layer is subjected to a difference processing with the sampling second adjacency matrix, and the resulting sampling second difference adjacency matrix is used as the sampling adjacency matrix corresponding to the jth hidden layer.
9. The method according to claim 1, characterized in that, The method of performing cascaded feature extraction processing on the graph data samples of the compound samples based on the sampling adjacency matrices corresponding to the multiple cascaded hidden layers to obtain the graph data features of the graph data samples of the compound samples includes: Feature extraction processing is performed on the graph data samples of the compound samples by combining the first hidden layer of the multiple cascaded hidden layers with the sampling adjacency matrix corresponding to the first hidden layer; The feature extraction result of the first hidden layer is output to the subsequent cascaded hidden layers, so that feature extraction processing and feature extraction result output can continue in the subsequent cascaded hidden layers until the last hidden layer is output. The feature extraction result output from the last hidden layer is used as the graph data feature of the graph data sample of the compound sample.
10. The method according to claim 9, characterized in that, The step of continuing feature extraction processing and outputting feature extraction results in the subsequent cascaded hidden layers includes: The following processing is performed through the i-th hidden layer of the plurality of cascaded hidden layers: The sampling adjacency matrix corresponding to the i-th hidden layer, the feature extraction result of the (i-1)-th hidden layer, and the learnable parameter matrix of the i-th hidden layer are multiplied to obtain the feature extraction result of the i-th hidden layer, and the feature extraction result of the i-th hidden layer is output to the (i+1)-th hidden layer. Where i is an increasing natural number and its value ranges from 2 ≤ i ≤ N-1, and N is the number of the multiple cascaded hidden layers.
11. The method according to claim 1, characterized in that, The training of the graph data classification model based on the graph data features of the compound samples includes: The graph data classification model is used to perform type prediction processing on the graph data features of the compound sample to obtain the predicted type of the graph data sample of the compound sample. Based on the predicted type of the graph data sample of the compound sample and the type label of the graph data sample of the compound sample, the loss function of the graph data classification model is constructed. Update the parameters of the graph data classification model until the loss function converges, and use the updated parameters of the graph data classification model when the loss function converges as the parameters of the trained graph data classification model.
12. A graph data classification model training device, characterized in that, The graph data classification model includes multiple cascaded hidden layers, and the device includes: The acquisition module is used to acquire the initial adjacency matrix corresponding to multiple edges in the graph data sample of the compound sample. The graph data sample is the graph structure of the compound sample. The nodes in the graph structure are molecules or atoms, and the edges in the graph structure represent the connecting bonds between molecules or the connecting bonds between atoms. The sampling module is used to perform correlation sampling processing on the initial adjacency matrix corresponding to the plurality of edges through each hidden layer to obtain the sampling adjacency matrix corresponding to each hidden layer; The feature extraction module is used to perform cascaded feature extraction processing on the graph data samples of the compound samples based on the sampling adjacency matrices corresponding to the multiple cascaded hidden layers, so as to obtain the graph data features of the graph data samples of the compound samples. The training module is used to train a graph data classification model based on the graph data features of the graph data samples of the compound samples; wherein, the trained graph data classification model is used to perform type prediction processing on the graph data of the compound to be classified, so as to obtain the type to which the graph data of the compound to be classified belongs.
13. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the graph data classification model training method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, It stores executable instructions for use by a processor to implement the graph data classification model training method according to any one of claims 1 to 11.
15. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the graph data classification model training method according to any one of claims 1 to 11.
Citation Information
Patent Citations
A convolution classification method and system for relational graph data
CN109918542A
Classification processing method and device and training method and device of graph convolutional neural network model
CN110674869A