Graph pooling, classification model training, reconstruction model training method and device
Through the graph pooling method of multi-dimensional vector scoring and node filtering of graph structure data, the problem of time-consuming and labor-intensive and insufficient accuracy of traditional methods is solved, and more efficient and accurate graph pooling and graph reconstruction are achieved.
Patent Information
- Application Number
- CN202111499659.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The traditional biomolecular structure graph pooling method is time-consuming and labor-intensive, and lacks the capture of node diversity, resulting in insufficient accuracy of graph classification or graph reconstruction.
By scoring the initial nodes in the graph structure data for multi-dimensional vectors, the nodes to be processed are determined, and graph pooling is performed based on the characteristics and structural relationships of these nodes, and a neural network model is used for characterization.
It improves the accuracy and efficiency of graph pooling, enhances the accuracy of graph classification or graph reconstruction, and is suitable for large-scale applications.
Smart Images

Figure CN114155410B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, specifically to technical fields such as deep learning, and especially to graph pooling methods and devices, classification model training methods and devices, reconstruction model training methods and devices, graph structure data classification methods and devices, graph structure data reconstruction methods and devices, electronic devices, computer-readable media, and computer program products. Background Art
[0002] In the biomedical field, it is usually necessary to classify the properties or reconstruct the graph of an unknown biological molecular structure. Using traditional biological analysis methods to determine the properties of molecules or molecular reconstruction is very time-consuming and labor-intensive. It is necessary to introduce a neural network model to efficiently and accurately classify the molecular properties or reconstruct molecules. In the process of using a neural network model to classify the properties or reconstruct molecules of biological molecular structures, it is necessary to first perform graph abstraction on the biological molecular structure to obtain graph structure data. The prediction of molecular properties or the reconstruction of molecules can be abstracted as graph classification or graph reconstruction of graph structure data.
[0003] Graph pooling technology is an indispensable technical means in tasks such as graph classification or graph reconstruction. Through graph pooling technology, the graph data structure can be represented in the neural network model. The rationality of graph pooling greatly affects the accuracy of graph classification or graph reconstruction. Summary of the Invention
[0004] The embodiments of the present disclosure propose a graph pooling method and device, a classification model training method and device, a reconstruction model training method and device, a graph structure data classification method and device, a graph structure data reconstruction method and device, an electronic device, a computer-readable medium, and a computer program product.
[0005] In a first aspect, an embodiment of the present disclosure provides a graph pooling method, which includes: obtaining graph structure data, the graph structure data including: features of initial nodes and structural relationships between each initial node; performing importance scoring on the features of each initial node in the graph structure data to obtain a score vector for each initial node; determining the nodes to be processed based on all initial nodes and the score vectors of each initial node, the number of nodes to be processed being less than or equal to the number of initial nodes; and obtaining a representation of the graph structure data based on the features of the nodes to be processed and the structural relationships between each node to be processed in the nodes to be processed.
[0006] In some embodiments, the above-mentioned importance scoring of the features of each initial node in the graph structure data to obtain a score vector of each initial node includes: using a multidimensional vector to represent the features of all initial nodes; and scoring the importance of the features of each initial node to obtain a multidimensional score vector of each initial node.
[0007] In some embodiments, the above-mentioned determination of the nodes to be processed based on all the initial nodes and the score vectors of each initial node includes: randomly discarding a set number of initial nodes from all the initial nodes to obtain remaining nodes; and selecting at least one initial node from the remaining nodes as the node to be processed based on the score vectors of each initial node in the remaining nodes.
[0008] In some embodiments, the above method further includes: performing regularization processing on the score vector of the node to be processed to obtain the score vector of the node to be processed, and the regularization processing includes: calculating an absolute value or a square calculation.
[0009] In a second aspect, an embodiment of the present disclosure provides a classification model training method, which includes: obtaining a training data set, the training data set includes at least one sample graph structure data, the sample graph structure data includes: the characteristics of the initial nodes and the structural relationship between each initial node; obtaining a pre-established classification network, the classification network includes: a graph pooling module and a classification module, the graph pooling module is used to perform the graph pooling method of the first aspect on the graph structure data to obtain a representation of the graph structure data, and the classification module obtains a classification result of the graph structure data based on the representation of the graph structure data; performing the following training steps: inputting the sample graph structure data selected from the training data set into the classification network, and calculating the loss value of the classification network; obtaining a classification model based on the loss value and the classification network.
[0010] In a third aspect, an embodiment of the present disclosure provides a reconstruction model training method, which includes: obtaining a training data set, the training data set includes at least one sample graph structure data, the sample graph structure data includes: the characteristics of the initial nodes and the structural relationship between each initial node; obtaining a pre-established reconstruction network, the reconstruction network includes: a graph pooling module and a reconstruction module, the graph pooling module is used to perform the graph pooling method of the first aspect on the graph structure data to obtain a representation of the graph structure data, and the reconstruction module obtains reconstructed data of the graph structure data based on the representation of the graph structure data; performing the following training steps: inputting the sample graph structure data selected from the training data set into the reconstruction network, and calculating the loss value of the reconstruction network; obtaining a reconstruction model based on the loss value and the reconstruction network.
[0011] In the fourth aspect, an embodiment of the present disclosure provides a method for classifying graph structure data, which includes: obtaining graph structure data to be classified, the graph structure data to be classified including: characteristics of the initial nodes and the structural relationship between each initial node; inputting the graph structure data to be classified into a classification model generated by the method of the second aspect, and outputting the classification result of the graph structure data to be classified.
[0012] In the fifth aspect, an embodiment of the present disclosure provides a method for reconstructing graph structure data, which includes: obtaining graph structure data to be reconstructed, where the graph structure to be reconstructed includes: characteristics of the initial nodes and the structural relationship between each initial node; inputting the graph structure data to be reconstructed into a reconstruction model generated by the method of the third aspect, and outputting reconstructed data of the graph structure data to be reconstructed.
[0013] In the sixth aspect, an embodiment of the present disclosure provides a graph pooling device, which includes: an acquisition unit, configured to acquire graph structure data, the graph structure data including: features of the initial nodes and the structural relationship between each initial node; a scoring unit, configured to score the importance of the features of each initial node in the graph structure data, and obtain a score vector for each initial node; a determination unit, configured to determine the nodes to be processed based on all initial nodes and the score vectors of each initial node, the number of nodes to be processed being less than or equal to the number of initial nodes; an acquisition unit, configured to obtain a representation of the graph structure data based on the features of the nodes to be processed and the structural relationship between each node to be processed.
[0014] In some embodiments, the scoring unit includes: a characterization module configured to use a multidimensional vector to characterize the features of all initial nodes; a scoring module configured to score the importance of the features of each initial node to obtain a multidimensional score vector for each initial node.
[0015] In some embodiments, the above-mentioned determination unit includes: a discarding module, configured to randomly discard a set number of initial nodes from all initial nodes to obtain remaining nodes; and a selection module, configured to select at least one initial node from the remaining nodes as a node to be processed based on the score vectors of each initial node in the remaining nodes.
[0016] In some embodiments, the apparatus further comprises: a regularization processing unit configured to perform regularization processing on the score vector of the node to be processed to obtain the score vector of the node to be processed, wherein the regularization processing comprises: calculating an absolute value or a square calculation.
[0017] In the seventh aspect, an embodiment of the present disclosure provides a classification model training device, which includes: a sample acquisition unit, configured to acquire a training data set, the training data set includes at least one sample graph structure data, the sample graph structure data includes: the characteristics of the initial nodes and the structural relationship between each initial node; a classification network unit, configured to acquire a pre-established classification network, the classification network includes: a graph pooling module and a classification module, the graph pooling module is used to perform the graph pooling method of the first aspect on the graph structure data to obtain a representation of the graph structure data, and the classification module obtains a classification result of the graph structure data based on the representation of the graph structure data; a calculation unit, configured to input the sample graph structure data selected from the training data set into the classification network, and calculate the loss value of the classification network; an obtaining unit, configured to obtain a classification model based on the loss value and the classification network.
[0018] In an eighth aspect, an embodiment of the present disclosure provides a reconstruction model training device, which includes: a sample acquisition unit, configured to acquire a training data set, the training data set includes at least one sample graph structure data, the sample graph structure data includes: characteristics of the initial nodes and the structural relationship between each initial node; a reconstruction network unit, configured to acquire a pre-established reconstruction network, the reconstruction network includes: a graph pooling module and a reconstruction module, the graph pooling module is used to perform the graph pooling method of the first aspect on the graph structure data to obtain a representation of the graph structure data, and the reconstruction module obtains reconstructed data of the graph structure data based on the representation of the graph structure data; a calculation unit, configured to input the sample graph structure data selected from the training data set into the reconstruction network, and calculate the loss value of the reconstruction network; an obtaining unit, configured to obtain a reconstruction model based on the loss value and the reconstruction network.
[0019] In the ninth aspect, an embodiment of the present disclosure provides a graph structure data classification device, which includes: a structure acquisition unit, configured to acquire graph structure data to be classified, and the graph structure data to be classified includes: characteristics of initial nodes and structural relationships between each initial node; a classification output unit, configured to input the graph structure into a classification model generated by the device of the seventh aspect, and output the classification result of the graph structure data to be classified.
[0020] In the tenth aspect, an embodiment of the present disclosure provides a graph structure data reconstruction device, which includes: a structure acquisition unit, configured to acquire graph structure data to be reconstructed, and the graph structure data to be reconstructed includes: characteristics of initial nodes and structural relationships between each initial node; an image output unit, configured to input the graph structure data to be reconstructed into a reconstruction model generated by the device of the eighth aspect, and output reconstructed data of the graph structure data to be reconstructed.
[0021] In the eleventh aspect, an embodiment of the present disclosure provides an electronic device comprising: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation method of the first to fifth aspects.
[0022] In a twelfth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any one of the implementation modes of the first to fifth aspects.
[0023] In a thirteenth aspect, an embodiment of the present disclosure provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any one of the implementation modes of the first to fifth aspects.
[0024] The graph pooling method and device provided by the embodiments of the present disclosure first obtain graph structure data; secondly, perform importance scoring on the features of each initial node in the graph structure data to obtain a score vector for each initial node; thirdly, determine the nodes to be processed based on all initial nodes and the score vectors of each initial node, where the number of nodes to be processed is less than or equal to the number of initial nodes; finally, obtain a representation of the graph structure data based on the features of the nodes to be processed and the structural relationship between each of the nodes to be processed. Thus, a neural network model can be used to perform score vector scoring on all initial nodes in the graph structure data, so that the representation of the obtained graph structure data can more accurately represent the graph structure data, thereby improving the accuracy of graph pooling and ensuring the large-scale application of graph pooling. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Other features, objects and advantages of the present disclosure will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
[0026] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
[0027] Figure 2 is a flowchart of an embodiment of a graph pooling method according to the present disclosure;
[0028] Figures 3a-3d is a schematic diagram of node changes in the graph pooling method according to the present disclosure;
[0029] Figure 4 is a flowchart of an embodiment of a classification model training method according to the present disclosure;
[0030] Figure 5is a flowchart of an embodiment of a reconstruction model training method according to the present disclosure;
[0031] Figure 6 is a flowchart of an embodiment of a method for classifying graph structured data according to the present disclosure;
[0032] Figure 7 is a flowchart of an embodiment of a method for reconstructing graph structure data according to the present disclosure;
[0033] Figure 8 is a structural diagram of an embodiment of a graph pooling device according to the present disclosure;
[0034] Figure 9 is a structural diagram of an embodiment of a classification model training device according to the present disclosure;
[0035] Figure 10 is a structural diagram of an embodiment of a reconstruction model training device according to the present disclosure;
[0036] Figure 11 is a structural diagram of an embodiment of a graph structure data classification device according to the present disclosure;
[0037] Figure 12 is a structural diagram of an embodiment of a graph structure data reconstruction device according to the present disclosure;
[0038] Figure 13 It is a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION
[0039] The present disclosure will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to illustrate the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the relevant invention are shown in the accompanying drawings.
[0040] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0041] In computer science, a graph is a collection of nodes that are paired (connected) by a series of edges. Nodes are represented by circles, and edges are the lines between these circles. Nodes are connected by edges.
[0042] When classifying the properties of biological molecular structures, the property analysis of molecules can be abstracted into a graph classification task. First, the biological molecules are abstracted to obtain the graph structure data of the biological molecules. Second, the graph pooling technology is used on the graph structure data of the biological molecules to obtain the representation of the graph structure data, and then the property type of the biological molecules is obtained based on the representation of the graph structure data.
[0043] In the retail field, when users search for product information, they can first abstract the various attributes of the product into graph structure data. Secondly, they can use graph pooling technology on the graph structure data of the attributes to obtain a complete graph structure data representation of the product. Based on the representation of the graph structure data of the product, they can retrieve the product.
[0044] Traditional graph pooling techniques can be roughly divided into two categories:
[0045] 1. Global graph pooling: This type of graph pooling ignores the network structure of the graph and performs operations such as averaging, maximizing, or summing all nodes to obtain a graph representation.
[0046] 2. Hierarchical graph pooling. This type of graph pooling comprehensively considers the characteristics of graph nodes and the structural relationships of nodes, gradually coarsening the graph until the final graph representation is obtained. Hierarchical graph pooling technology can be roughly divided into:
[0047] (1) Node clustering graph pooling. This type of graph pooling clusters multiple similar nodes to generate a new node to represent the original multiple nodes, thereby gradually coarsening the graph until a graph representation is obtained.
[0048] (2) Node-discarding graph pooling. This type of graph pooling calculates the importance scores of nodes through the model, and then retains important nodes and their connections based on the scores, discarding unimportant nodes, thereby coarsening the graph until a graph representation is obtained.
[0049] Among them, node-dropping graph pooling has lower time and space complexity and has better application prospects in real-world large-scale networks. However, traditional node-dropping graph pooling techniques fail to capture the diversity of nodes in the graph, resulting in redundant node feature information in the final features and the loss of some important feature information.
[0050] Compared to traditional node-discarding graph pooling, the graph pooling method provided by this disclosure helps the network capture the diversity of node features. This allows the representation of graph structure data acquired by the model to more comprehensively and accurately represent the original graph structure data, improving the accuracy of graph classification or reconstruction tasks. The graph pooling method provided by this disclosure can be combined with many node-discarding graph pooling models to improve and enhance these models.
[0051] Figure 1An exemplary system architecture 100 is shown to which the classification model training method, reconstruction model training method, or graph pooling method of the present disclosure can be applied.
[0052] like Figure 1 As shown, system architecture 100 may include terminals 101 and 102, a network 103, a database server 104, and a server 105. Network 103 is used to provide a medium for communication links between terminals 101 and 102, database server 104, and server 105. Network 103 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0053] User 110 can use terminals 101 and 102 to interact with server 105 via network 103 to receive or send messages, etc. Various client applications can be installed on terminals 101 and 102, such as model training applications, graph structure data recognition applications, and instant messaging tools.
[0054] The terminals 101 and 102 herein can be either hardware or software. When the terminals 101 and 102 are hardware, they can be various electronic devices with display screens, including but not limited to smartphones, tablet computers, e-book readers, laptop computers, and desktop computers. When the terminals 101 and 102 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. No specific limitations are given here.
[0055] When terminals 101 and 102 are hardware, they may also be equipped with a graph structure data acquisition device. The graph structure data acquisition device may be any device capable of acquiring graph structure data, such as a camera, sensor, etc. User 110 may utilize the graph structure data acquisition device on terminals 101 and 102 to acquire graph structure data.
[0056] Database server 104 can be a database server that provides various services. For example, the database server can store a training dataset or graph structure data to be pooled. The training dataset contains a large number of samples. A sample can include at least one sample graph structure data. Thus, user 110 can also select a sample from the sample set stored in database server 104 through terminals 101 and 102.
[0057] The server 105 may also be a server that provides various services, such as a background server that provides support for various applications displayed on the terminals 101 and 102. The background server may use the samples in the sample set sent by the terminals 101 and 102 to train the initial model, and may send the training results (such as the generated classification model) to the terminals 101 and 102. In this way, the user can apply the generated classification model to classify nodes. The background server may also perform pooling processing on the graph structure data to be pooled in the terminals 101 and 102 or the database server 104 to obtain a representation of the graph structure data to be pooled.
[0058] The database server 104 and server 105 herein can also be hardware or software. When they are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When they are software, they can be implemented as multiple software programs or software modules (for example, to provide distributed services), or as a single software program or software module. No specific limitation is given herein.
[0059] It should be noted that the classification model training method, reconstruction model training method, graph structure data classification method, graph structure data reconstruction method, or graph pooling method provided in the embodiments of the present disclosure are generally executed by the server 105. Accordingly, the classification model training device, reconstruction model training device, graph structure data classification device, graph structure data reconstruction device, or graph pooling device are generally also provided in the server 105.
[0060] It should be noted that, in the case where the server 105 can implement the relevant functions of the database server 104 , the database server 104 may not be provided in the system architecture 100 .
[0061] It should be understood that Figure 1 The numbers of terminals, networks, database servers, and servers in the embodiment are merely illustrative. Any number of terminals, networks, database servers, and servers may be provided as needed.
[0062] like Figure 2 , shows a process 200 of an embodiment of a graph pooling method according to the present disclosure, the graph pooling method comprising the following steps:
[0063] Step 201: Acquire graph structure data.
[0064] In this embodiment, the graph structure data includes the initial node and the structural relationship between each initial node among all the initial nodes, and the structural relationship between each initial node is also called an edge set. The initial node can be any arranged object in the graph structure data, and the characteristics of the initial node are also the characteristics of the object. The characteristics of the initial node can be obtained by extracting information about the object in the graph by a graph convolutional neural network. The characteristics of the initial node can be used to characterize information such as the position, type, size, etc. of the object in the graph structure data.
[0065] It should be noted that the initial nodes, nodes to be processed, and remaining nodes in this embodiment are all nodes of graph structure data, which are used to represent objects in the graph structure data; the structural relationship between the initial nodes is the position, dependency, and other information between each initial node.
[0066] like Figure 3a As shown, the initial nodes include: point A to point G, and the connecting lines between points A to point G represent the structural relationship between each point, and all the connecting lines are combined to obtain the edge set of the initial node.
[0067] First, a graph is given: G = V, E. Among them, G represents the graph, V represents the initial node set, and v i Represents the initial node i, i∈1,2,...,n, n is the total number of initial nodes in the graph, E represents the edge set, and the adjacency matrix of the graph is defined as A.
[0068] Step 202 : perform importance scoring on the features of each initial node in the graph structure data to obtain a score vector for each initial node.
[0069] In this embodiment, a scoring function can be used to score the importance of the features of each initial node in the graph structure data, thereby determining the importance of each initial node in the initial node set. (l) Score all nodes generated by the SCORE function in the model, S (l) =SCORE(X (l) , A (l) ), where SCORE() represents the scoring function and X(l) represents the features of the initial node.
[0070] Traditional graph pooling methods generally use scalars to represent the importance of each node in graph structure data. However, due to the complexity of graph structure data, simple scalars are difficult to evaluate the importance of nodes from different perspectives. In this embodiment, the score vector of the initial node is a representation of the scores of the initial node from different perspectives, such as Figure 3bAs shown, (0.4, 0.3) is the score vector of point A, (0.7, 0.2) is the score vector of point B, (0.9, 0.6) is the score vector of point C, (0.5, 0.4) is the score vector of point D, (-0.2, -0.1) is the score vector of point E, (-0.6, -0.3) is the score vector of point F, and (-0.8, -0.2) is the score vector of point G. The importance of the initial node to the initial node set can be determined from different perspectives in the form of score vectors. By changing the importance score of each initial node from a scalar to a vector, the importance of the node can be evaluated from multiple perspectives.
[0071] Furthermore, when running the graph pooling method in a neural network model, the one-dimensional score generated in the original model can be expanded to a multi-dimensional score, and the importance score of each initial node can be changed from a scalar to a multi-dimensional vector, so that the importance of the node can be evaluated from multiple perspectives.
[0072] In some optional implementations of this embodiment, the features of each initial node are scored for importance to obtain a score vector for each initial node, including: using a multidimensional vector to represent the features of all initial nodes; and scoring the features of each initial node for importance to obtain a multidimensional score vector for each initial node.
[0073] In this embodiment, the multi-dimensional score vectors of each initial node can be represented by a multi-dimensional scoring matrix, and each row in the scoring matrix represents the importance score vector of the initial node.
[0074] The method provided by this optional implementation method represents the features of all initial nodes as multi-dimensional vectors, so that when the scoring function scores the features of each initial node, the scores of the features of the initial nodes can also be represented in multiple dimensions, ensuring that the importance of the nodes is evaluated from multiple perspectives.
[0075] Step 203: Determine the nodes to be processed based on all the initial nodes and the score vectors of each initial node.
[0076] The number of nodes to be processed is less than or equal to the number of initial nodes.
[0077] In this embodiment, the node to be processed is a node selected from all initial nodes. The node to be processed may be a node that the graph pooling model considers to maximize the representation of graph structure data.
[0078] The above-mentioned determination of the nodes to be processed based on all initial nodes and the score vectors of each initial node includes: sorting the initial nodes in the initial nodes in ascending order according to the size of the score vectors of each initial node in the initial nodes; selecting the initial node with the score vector as the preset position as the node to be processed. The preset position can be set based on the business requirements of the model, for example, the preset position is 20. Figure 3c As shown, points A to D are points to be processed selected from all initial nodes from points A to G based on the score vector.
[0079] In some optional implementations of this embodiment, the above-mentioned determining the nodes to be processed based on all initial nodes and the score vectors of each initial node includes: randomly discarding a set number of initial nodes from all initial nodes to obtain remaining nodes; and selecting at least one initial node from the remaining nodes as the node to be processed based on the score vectors of each initial node in the remaining nodes.
[0080] In this optional implementation, the above-mentioned selecting at least one initial node from the remaining nodes as the node to be processed based on the score vectors of each initial node from the remaining nodes includes: sorting the initial nodes from the remaining nodes according to the size of the score vectors of each initial node from the remaining nodes; and selecting the initial node whose score vector is a preset position as the node to be processed.
[0081] In this optional implementation, the set number can be set based on the model business (such as graph structure data classification, graph structure data reconstruction) requirements, for example, the set number is 1,000.
[0082] In this optional implementation, before determining the nodes to be processed, a set number of initial nodes are randomly discarded, and accordingly, the structural relationships between the respective initial nodes in the discarded set number of initial nodes are also discarded accordingly.
[0083] In traditional graph pooling methods, when a neural network model begins processing graph-structured data, the directly connected initial nodes in the graph often contain a lot of similar information, and the neural network model generates similar scores for nearby initial nodes. In this case, the neural network model may become trapped in certain important local structures, causing it to select redundant initial nodes and ignore important initial nodes in other substructures, thereby losing some structural information.
[0084] The graph pooling method provided by this optional implementation randomly discards a set number of initial nodes and randomly deletes a certain proportion of nodes during the training process of the neural network model, so that the neural network model is no longer trapped in a certain local substructure, thereby ensuring the effectiveness of graph pooling.
[0085] Step 204 : obtaining a representation of the graph structure data based on the features of the nodes to be processed and the structural relationships between the nodes to be processed.
[0086] In this embodiment, the representation of the graph structure data is the characteristics of the graph structure data determined by the execution subject (e.g., the graph pooling model) on which the graph pooling method runs. The overall structure of the objects in the graph structure data can be determined in the graph pooling model through the representation of the graph structure data. The above-mentioned execution subject can use the graph coarsening function to process the characteristics of the to-be-processed nodes and the structural relationship between each to-be-processed node in the to-be-processed nodes to obtain the representation of the graph structure data. Furthermore, the representation of the graph structure data can exist in the graph pooling model in the form of a code that can be recognized by the model.
[0087] like Figure 3d As shown, points A to D are points to be processed. Based on the features of points A to D and the structural relationship between points A to D, the image structure data can be completely coarsened.
[0088] The graph pooling method provided by the embodiment of the present disclosure first obtains graph structure data; secondly, the importance of the features of each initial node in the graph structure data is scored to obtain a score vector for each initial node; thirdly, based on all initial nodes and the score vectors of each initial node, the nodes to be processed are determined, and the number of nodes to be processed is less than or equal to the number of initial nodes; finally, based on the features of the nodes to be processed and the structural relationship between each of the nodes to be processed, a representation of the graph structure data is obtained. Thus, a neural network model can be used to score the score vectors of all initial nodes in the graph structure data, so that the representation of the obtained graph structure data can more accurately represent the graph structure data, improve the accuracy of graph pooling, and ensure the large-scale application of graph pooling.
[0089] In another embodiment of the present disclosure, the graph pooling method of the present disclosure may further include: performing regularization processing on the score vector of the node to be processed to obtain the score vector of the node to be processed, and the regularization processing includes: calculating the absolute value or square calculation.
[0090] In traditional technologies, graph pooling models generally use the hyperbolic tangent function Tanh() as the activation function. The generation score of the graph pooling model is between -1 and 1, so traditional methods tend to select similar initial nodes rather than representative initial nodes.
[0091] The graph pooling method provided in this embodiment can highlight nodes with extremely different scores in the original space of the graph pooling model by regularizing the nodes to be processed, encourage the graph pooling model to capture nodes with different features, and enable the features of dissimilar initial nodes to obtain more information gain, thereby helping to improve the accuracy of graph structure data classification or graph structure data reconstruction.
[0092] like Figure 4 , shows a process 400 of an embodiment of a classification model training method according to the present disclosure, the classification model training method comprising the following steps:
[0093] Step 401: Obtain a training data set.
[0094] In this embodiment, the execution subject of the classification model training method (eg Figure 1 The server shown in the figure can obtain the training data set in a variety of ways. In this embodiment, the training data set includes at least one sample graph structure data. The sample graph structure data includes: the characteristics of the initial nodes and the structural relationship between the initial nodes. By selecting and calculating the sample graph structure data in the training data set, samples suitable for classification model training can be obtained. For example, the execution subject can obtain the training data from the database server (for example) through a wired connection or a wireless connection. Figure 1 For example, the user can obtain the training data set stored therein from the database server 104 shown in FIG. Figure 1 Terminals 101, 102 as shown) are used to collect training data sets.
[0095] Here, each sample graph structure data includes the annotation information of the graph structure data, and the annotation information is used for true value recognition during classification model training.
[0096] Step 402: Acquire a pre-established classification network.
[0097] In this embodiment, the graph pooling method provided in the above embodiment can be applied to the graph structure data classification scenario. Graph structure data classification involves identifying the type or confidence level of an object in the graph structure data to obtain the probability that the object belongs to the graph structure data. The object can be information such as the object, type, model, and structure that characterizes the graph structure data.
[0098] By applying the graph pooling method in the classification scenario, we can classify each node into different types based on the representation of the graph structure data, and obtain the type of the node or the probability that the node belongs to the target in the graph structure data.
[0099] In this embodiment, the classification network includes a graph pooling module and a classification module. The graph pooling module is used to perform the graph pooling method of this embodiment on graph structure data to obtain a representation of the graph structure data. The classification module obtains a classification result for the graph structure data based on the representation of the graph structure data. The output of the graph pooling module is connected to the input of the classification module, and the output of the classification module serves as the output of the classification network.
[0100] In this embodiment, graph structure data is input into the graph pooling module to obtain a representation of the graph structure data. The representation of the graph structure data is then input into the classification module to obtain a classification result for the graph structure data. The classification result may include: node location, probability of a node belonging to a preset target, confidence level, etc.
[0101] In this embodiment, the graph pooling module can adopt a neural network, the classification module can be at least one fully connected layer, the graph pooling module and the classification module constitute a classification network, and each time the classification network performs iterative training, the graph pooling module executes a graph pooling method on the graph structure data to obtain a representation of the graph structure data under the current iterative training.
[0102] In step 403, the sample graph structure data selected from the training data set is input into the classification network to calculate the loss value of the classification network.
[0103] In this embodiment, the execution entity selects sample graph structure data from the training data set based on the training data set obtained from step 401, uses the selected sample graph structure data as the sample for each iteration training of the classification network, and executes the training steps from step 403 to step 404 based on the selected sample graph structure data.
[0104] In this embodiment, in each iterative training, the loss value of the classification network is calculated based on the loss value of the graph pooling module and the loss value of the classification module, and the loss value of the graph pooling module and the loss value of the classification module can both be calculated through the selected sample graph structure data and their respective loss functions.
[0105] In this embodiment, the loss value of the graph pooling module and the loss value of the classification module can be added to obtain the loss value of the classification network; or the loss value of the graph pooling module can be multiplied by the first preset coefficient and the loss value of the classification module can be multiplied by the second preset coefficient to obtain the loss value of the classification network.
[0106] Step 404: Obtain a classification model based on the loss value and the classification network.
[0107] In this embodiment, after multiple iterations of training, the loss value of the classification network is used to detect whether the classification network meets the training completion condition. If the classification network meets the training completion condition, the classification network is used as the classification model.
[0108] In this embodiment, the training completion condition includes at least one of the following: the number of training iterations reaches a predetermined iteration threshold (a threshold pre-estimated from the loss value of the classification network), and the loss value of the classification network is less than the predetermined loss value threshold. For example, the number of training iterations reaches 5,000, and the loss value is less than 0.05. Setting the training completion condition can accelerate model convergence.
[0109] Optionally, if the classification network does not meet the training completion conditions, the relevant parameters in the classification network are adjusted so that the loss value of the classification network converges, and steps 403-404 are continued based on the adjusted classification network and the loss value of the adjusted classification network.
[0110] In this optional implementation, after each iterative training, if the classification network does not meet the training completion requirement, the classification model can be quickly obtained by adjusting the relevant parameters of the classification network, thereby ensuring the convergence effect of the model.
[0111] The classification model training method provided by the embodiments of the present disclosure adopts the graph pooling method of the present disclosure, thereby ensuring the effective representation of graph structure data, improving the performance of the classification model, and improving the classification accuracy of the classification model.
[0112] like Figure 5 , shows a process 500 of an embodiment of a reconstruction model training method according to the present disclosure, the reconstruction model training method comprising the following steps:
[0113] Step 501: Obtain a training data set.
[0114] In this embodiment, the execution subject of the reconstruction model training method (eg Figure 1 The server shown in the figure can obtain the training data set in a variety of ways. In this embodiment, the training data set includes at least one sample graph structure data. The sample graph structure data includes: the characteristics of the initial nodes and the structural relationship between the initial nodes. By selecting and calculating the sample graph structure data in the training data set, samples suitable for reconstructing the model training can be obtained. For example, the execution subject can obtain the training data from the database server (for example) through a wired connection or a wireless connection. Figure 1 For example, the user can obtain the training data set stored therein from the database server 104 shown in FIG. Figure 1 Terminals 101, 102 as shown) are used to collect training data sets.
[0115] Here, each sample graph structure data includes the annotation information of the graph structure data, and the annotation information is used for true value recognition during reconstruction model training.
[0116] Step 502: Acquire a pre-established reconstruction network.
[0117] In this embodiment, the graph pooling method provided in the above embodiment can be applied to the graph structure data reconstruction scenario, wherein the graph structure data reconstruction is the process of restoring the graph structure data based on the representation of the graph structure data after the model obtains the representation of the graph structure data.
[0118] By applying the graph pooling method in the reconstruction scene, we can restore the graph structure data information of each node on the basis of obtaining the representation of the graph structure data, and obtain the graph structure data information corresponding to the node.
[0119] In this embodiment, the reconstruction network includes a graph pooling module and a reconstruction module. The graph pooling module is used to perform the graph pooling method of this embodiment on graph structure data to obtain a representation of the graph structure data. The reconstruction module obtains reconstructed data of the graph structure data based on the representation of the graph structure data. The output of the graph pooling module is connected to the input of the reconstruction module, and the output of the reconstruction module serves as the output of the reconstruction network.
[0120] In this embodiment, the graph structure data is input into the graph pooling module to obtain a representation of the graph structure data. The obtained representation of the graph structure data is then input into the reconstruction module to obtain reconstructed data after reconstructing the nodes to be processed in the graph structure data. In this embodiment, the reconstructed data is the data after the graph structure data is reconstructed, and may include: reconstructed nodes and the structural relationships between the reconstructed nodes.
[0121] In this embodiment, the graph pooling module can adopt a neural network. The representation of the graph structure data obtained by the graph pooling module is equivalent to the result after encoding the graph structure data, and the reconstruction module can be a decoder corresponding to the representation of the graph structure data. The graph pooling module and the reconstruction module constitute a reconstruction network. Each time the reconstruction network performs iterative training, the graph pooling module executes a graph pooling method on the graph structure data to obtain the representation of the graph structure data under the current iterative training.
[0122] In step 503, the sample graph structure data selected from the training data set is input into the reconstruction network to calculate the loss value of the reconstruction network.
[0123] In this embodiment, the execution entity selects sample graph structure data from the training data set based on the training data set obtained from step 501, uses the selected sample graph structure data as the sample for each iterative training of the reconstruction network, and executes the training steps from step 503 to step 504 based on the graph structure of the selected sample graph structure data.
[0124] In this embodiment, in each iterative training, the loss value of the reconstructed network is calculated based on the loss value of the graph pooling module and the loss value of the reconstruction module, and the loss value of the graph pooling module and the loss value of the reconstruction module can both be calculated through the graph structure of the selected sample graph structure data and their respective loss functions.
[0125] In this embodiment, the loss value of the graph pooling module and the loss value of the reconstruction module can be added to obtain the loss value of the reconstructed network; or the loss value of the graph pooling module can be multiplied by the third preset coefficient and the loss value of the reconstruction module can be multiplied by the fourth preset coefficient to obtain the loss value of the reconstructed network.
[0126] Step 504: Obtain a reconstruction model based on the loss value and the reconstruction network.
[0127] In this embodiment, after multiple iterations of training, the loss value of the reconstructed network is used to detect whether the reconstructed network meets the training completion condition. If the reconstructed network meets the training completion condition, the reconstructed network is used as the reconstruction model.
[0128] In this embodiment, the training completion condition includes at least one of the following: the number of training iterations reaches a predetermined iteration threshold (a threshold pre-estimated by the loss value of the reconstructed network), and the loss value of the reconstructed network is less than a predetermined loss value threshold. For example, the number of training iterations reaches 3,000, and the loss value is less than 0.03. Setting the training completion condition can accelerate model convergence.
[0129] Optionally, if the reconstructed network does not meet the training completion condition, the relevant parameters in the reconstructed network are adjusted so that the loss value of the reconstructed network converges, and steps 503-504 are continued based on the adjusted reconstructed network and the loss value of the adjusted reconstructed network.
[0130] In this optional implementation, after each iterative training, if the reconstructed network does not meet the training completion requirement, the reconstructed model can be quickly obtained by adjusting the relevant parameters of the reconstructed network, thereby ensuring the convergence effect of the model.
[0131] The reconstruction model training method provided by the embodiments of the present disclosure adopts the graph pooling method of the present disclosure, thereby ensuring the effective representation of graph structure data, improving the performance of the reconstruction model, and improving the accuracy of the reconstruction model in obtaining the reconstructed graph structure data.
[0132] See Figure 6 , which shows a process 600 of an embodiment of a method for classifying graph structured data provided by the present disclosure. The method for classifying graph structured data may include the following steps:
[0133] Step 601: Obtain graph structure data to be classified.
[0134] In this embodiment, the execution subject of the graph structure data classification method (for example Figure 1 The server 105 shown in FIG. 105 can obtain the graph structure data to be classified in a variety of ways. For example, the execution subject can obtain the graph structure data from the database server (e.g. Figure 1 For example, the execution subject may also receive the graph structure data to be classified stored in the database server 104 shown in FIG. Figure 1 The graph structure data to be classified is collected by the terminals 101, 102) or other devices.
[0135] In this embodiment, the graph structure data to be classified is graph structure data that needs to be classified. The graph structure data to be classified includes: the characteristics of the initial nodes and the structural relationship between each initial node. The graph structure of the graph structure data to be classified can be obtained by traditional methods. For example, it is necessary to classify the properties (such as toxic or non-toxic) of an unknown biological molecular structure. The property prediction task of the molecular structure can be abstracted as a graph classification task. A graph convolutional neural network is applied to the graph of the molecular structure to obtain the characteristics of each initial node in the graph and the structural relationship between each initial node.
[0136] Step 602: input the graph structure data to be classified into a classification model generated by using a classification model training method, and output a classification result of the graph structure data to be classified.
[0137] In this embodiment, the execution entity can input the graph structure data to be classified obtained in step 601 into the classification model, thereby outputting the classification result of the graph structure data to be classified. The graph structure data classification model trained and generated in steps 401-404 can obtain the classification result of the graph structure data to be classified.
[0138] For example, the classification result may include the type, nature, style, etc. of the graph structure data to be classified. The classification result may also include information such as the identity, type, and confidence level of the target in the graph structure data to be classified.
[0139] In this embodiment, the classification model can be as described above. Figure 4 The specific generation process can be found in Figure 4 The relevant description of the embodiment will not be repeated here.
[0140] It should be noted that the graph structure data classification method of this embodiment can be used to test the classification models generated by the above embodiments. Furthermore, the classification model can be continuously optimized based on the conversion results. This method can also be a practical application of the classification models generated by the above embodiments. Using the classification models generated by the above embodiments to classify graph structure data can help improve the performance of graph structure data classification.
[0141] The graph structure data classification method provided by the embodiments of the present disclosure can effectively classify graph structure data by adopting a classification model generated by a classification model training method, thereby ensuring the classification effect of the graph structure data.
[0142] See Figure 7 , which shows a process 700 of an embodiment of a method for reconstructing graph structure data provided by the present disclosure. The method for reconstructing graph structure data may include the following steps:
[0143] Step 701: Obtain graph structure data to be reconstructed.
[0144] In this embodiment, the execution subject of the graph structure data reconstruction method (for example Figure 1 The server 105 shown in FIG. 105 can obtain the graph structure data to be reconstructed in a variety of ways. For example, the execution subject can obtain the graph structure data from the database server (e.g. Figure 1 The execution subject may also receive the graph structure data to be reconstructed stored in the database server 104 shown in FIG. Figure 1 The graph structure data to be reconstructed is collected by the terminals 101, 102) or other devices.
[0145] In this embodiment, the graph structure data to be reconstructed is unknown graph structure data, and the unknown graph structure data can be used to reconstruct the unknown graph structure data to obtain a true representation of the graph structure data. The graph structure data to be reconstructed can be obtained through traditional methods, such as using a convolutional neural network to obtain the features of each initial node in the graph and the structural relationships between the initial nodes.
[0146] Step 702: input the graph structure data to be reconstructed into a reconstruction model generated by using a reconstruction model training method, and output reconstructed data of the graph structure data to be reconstructed.
[0147] In this embodiment, the execution subject can input the graph structure data to be reconstructed obtained in step 701 into the reconstruction model, thereby outputting the reconstruction data of the graph structure data to be reconstructed. The reconstruction model trained and generated in steps 501-504 can obtain the reconstruction data of the graph structure data to be reconstructed.
[0148] In this embodiment, the reconstructed data of the graph structure data to be reconstructed is graph structure data that truly represents the unknown graph structure data. The reconstructed graph structure data can be used in various graph structure data recognition and graph structure data classification scenarios.
[0149] In this embodiment, the reconstruction model can be as described above. Figure 5 The specific generation process can be found in Figure 5 The relevant description of the embodiment will not be repeated here.
[0150] It should be noted that the graph structure data reconstruction method of this embodiment can be used to test the reconstruction models generated by the aforementioned embodiments. Furthermore, the reconstruction models can be continuously optimized based on the conversion results. This method can also be a practical application of the reconstruction models generated by the aforementioned embodiments. Using the reconstruction models generated by the aforementioned embodiments to reconstruct graph structure data can help improve the performance of graph structure data reconstruction.
[0151] The graph structure data reconstruction method provided by the embodiments of the present disclosure can effectively restore the graph structure of the graph structure data by adopting the reconstruction model generated by the reconstruction model training method, thereby ensuring the effect of graph structure data reconstruction.
[0152] Further references Figure 8 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a graph pooling device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0153] like Figure 8 As shown, an embodiment of the present disclosure provides a graph pooling device 800, and the device 800 includes: an acquisition unit 801, a scoring unit 802, a determination unit 803, and an obtaining unit 804. Among them, the acquisition unit 801 can be configured to obtain graph structure data, and the graph structure data includes: features of the initial nodes and the structural relationship between each initial node. The scoring unit 802 can be configured to perform importance scoring on the features of each initial node in the graph structure data to obtain a score vector for each initial node. The determination unit 803 can be configured to determine the nodes to be processed based on all the initial nodes and the score vectors of each initial node, and the number of nodes to be processed is less than or equal to the number of initial nodes. The obtaining unit 804 can be configured to obtain a representation of the graph structure data based on the features of the nodes to be processed and the structural relationship between each node to be processed in the nodes to be processed.
[0154] In this embodiment, the specific processing of the acquisition unit 801, the scoring unit 802, the determination unit 803, and the obtaining unit 804 and the technical effects thereof can be referred to in the respective embodiments. Figure 2 These correspond to steps 201, 202, 203, and 204 in the embodiment.
[0155] In some embodiments, the scoring unit 802 includes a characterization module (not shown) and a scoring module (not shown). The characterization module can be configured to characterize the features of all initial nodes using a multidimensional vector. The scoring module can be configured to score the importance of the features of each initial node to obtain a multidimensional score vector for each initial node.
[0156] In some embodiments, the determination unit 803 includes a discarding module (not shown) and a selecting module (not shown). The discarding module may be configured to randomly discard a set number of initial nodes from all initial nodes to obtain remaining nodes. The selecting module may be configured to select at least one initial node from the remaining nodes as a node to be processed based on the score vectors of each initial node in the remaining nodes.
[0157] In some embodiments, the apparatus 800 further includes a regularization processing unit (not shown). The regularization processing unit may be configured to perform regularization processing on the score vector of the node to be processed to obtain the score vector of the node to be processed, wherein the regularization processing includes: calculating an absolute value or a square calculation.
[0158] The graph pooling device provided by the embodiment of the present disclosure first obtains the graph structure data by the acquisition unit 801; secondly, the scoring unit 802 scores the importance of the features of each initial node to obtain the score vector of each initial node; thirdly, the determination unit 803 determines the nodes to be processed based on all the initial nodes and the score vectors of each initial node, and the number of the nodes to be processed is less than or equal to the number of the initial nodes; finally, the acquisition unit 804 obtains the representation of the graph structure data based on the features of the nodes to be processed and the structural relationship between each node to be processed in the nodes to be processed. Thus, a neural network model can be used to score the score vectors of all the initial nodes in the graph structure data, so that the representation of the acquired graph structure data can more accurately represent the graph structure data, improve the accuracy of graph pooling, and ensure the large-scale application of graph pooling.
[0159] Continue to see Figure 9 , as a response to the above Figure 4 The present application provides a classification model training device, which is similar to the Figure 4 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0160] like Figure 9As shown, the classification model training device 900 of this embodiment may include: a sample acquisition unit 901, a classification network unit 902, a calculation unit 903, and an acquisition unit 904. The sample acquisition unit may be configured to acquire a training data set, the training data set includes at least one sample graph structure data, the sample graph structure data includes: the characteristics of the initial nodes and the structural relationship between each initial node. The classification network unit 902 may be configured to acquire a pre-established classification network, the classification network includes: a graph pooling module and a classification module, the graph pooling module is used to perform the graph pooling method of this embodiment on the graph structure data to obtain a representation of the graph structure data, and the classification module obtains a classification result of the graph structure data based on the representation of the graph structure data. The calculation unit 903 may be configured to input the sample graph structure data selected from the training data set into the classification network and calculate the loss value of the classification network. The acquisition unit 904 may be configured to obtain a classification model based on the loss value and the classification network.
[0161] In this embodiment, the specific processing of the sample acquisition unit 901, the classification network unit 902, the calculation unit 903, and the obtaining unit 904 and the technical effects thereof can be referred to in the respective Figure 4 These correspond to steps 401, 402, 403 and 404 in the embodiment.
[0162] Continue to see Figure 10 , as a response to the above Figure 5 The present application provides a reconstruction model training device, which is similar to the Figure 5 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0163] like Figure 10As shown, the reconstruction model training device 1000 of this embodiment may include: a sample acquisition unit 1001, a reconstruction network unit 1002, a calculation unit 1003, and an acquisition unit 1004. The sample acquisition unit may be configured to acquire a training data set, the training data set includes at least one sample graph structure data, the sample graph structure data includes: the characteristics of the initial nodes and the structural relationship between each initial node. The reconstruction network unit 1002 may be configured to acquire a pre-established reconstruction network, the reconstruction network includes: a graph pooling module and a reconstruction module, the graph pooling module is used to perform the graph pooling method of this embodiment on the graph structure data to obtain the representation of the graph structure data, and the reconstruction module obtains the reconstruction data of the graph structure data based on the representation of the graph structure data. The calculation unit 1003 may be configured to input the sample graph structure data selected from the training data set into the reconstruction network, and calculate the loss value of the reconstruction network. The acquisition unit 1004 may be configured to obtain a reconstruction model based on the loss value and the reconstruction network.
[0164] In this embodiment, the specific processing of the sample acquisition unit 1001, the reconstruction network unit 1002, the calculation unit 1003, and the obtaining unit 1004 and the technical effects thereof can be referred to in the respective Figure 5 These correspond to steps 501, 502, 503, and 504 in the embodiment.
[0165] Continue to see Figure 11 , as a response to the above Figure 9 The present application provides an embodiment of a graph structure data classification device. Figure 9 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0166] like Figure 11 As shown, the graph structure data classification device 1100 of this embodiment may include: a structure acquisition unit 1101, configured to acquire the graph structure data to be classified, the graph structure data to be classified including: the features of the initial nodes and the structural relationships between the initial nodes. A classification output unit 1102, configured to input the graph structure as described above Figure 9 In the classification model generated by the classification model training device shown, the classification results of the graph structure data to be classified are output.
[0167] It is understood that the units described in the device 1100 are similar to those in the reference Figure 9 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 1100 and the units included therein, and will not be repeated here.
[0168] Continue to see Figure 12 , as a response to the above Figure 10 The present application provides an embodiment of a graph structure data reconstruction device. Figure 10 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0169] like Figure 12 As shown, the graph structure data reconstruction device 1200 of this embodiment may include: a structure acquisition unit 1201, configured to acquire the graph structure data to be reconstructed, the graph structure data to be reconstructed includes: the features of the initial nodes and the structural relationship between the initial nodes. An image output unit 1202, configured to input the graph structure as described above Figure 10 In the reconstruction model generated by the reconstruction model training device shown, reconstruction data of the graph structure data to be reconstructed is output.
[0170] It is understood that the units described in the device 1200 are similar to those in the reference Figure 10 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 1200 and the units included therein, and will not be repeated here.
[0171] It should be noted that the graph structure data, personal information and other data involved in the embodiments of the present disclosure have been voluntarily authorized by the user, and the acquisition, storage, processing and transmission of personal information data are in compliance with the requirements of relevant laws and regulations.
[0172] Reference below Figure 13 , which shows a structural diagram of an electronic device 1300 suitable for implementing the embodiments of the present disclosure.
[0173] like Figure 13 As shown, the electronic device 1300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage device 1308 into a random access memory (RAM) 1303. Various programs and data required for the operation of the electronic device 1300 are also stored in the RAM 1303. The processing device 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.
[0174] Typically, the following devices may be connected to the I / O interface 1305: an input device 1306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, etc.; an output device 1307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1309. The communication device 1309 may allow the electronic device 1300 to communicate with other devices wirelessly or by wire to exchange data. Figure 13 The electronic device 1300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 13 Each block shown in the figure may represent one device, or may represent multiple devices as needed.
[0175] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 1309, or installed from the storage device 1308, or installed from the ROM 1302. When the computer program is executed by the processing device 1301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0176] It should be noted that the computer-readable medium of the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or convey a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code embodied on the computer-readable medium may be conveyed using any suitable medium, including but not limited to wires, optical cables, RF (Radio Frequency), or any suitable combination thereof.
[0177] The computer-readable medium may be included in the server, or may exist independently and not be incorporated into the server. The computer-readable medium carries one or more programs that, when executed by the server, cause the server to: obtain graph structure data, the graph structure data including: features of initial nodes and structural relationships between each initial node; perform importance scoring on the features of each initial node in the graph structure data to obtain a score vector for each initial node; determine to-be-processed nodes based on all initial nodes and the score vectors of each initial node, where the number of to-be-processed nodes is less than or equal to the number of initial nodes; and obtain a representation of the graph structure data based on the features of the to-be-processed nodes and the structural relationships between each of the to-be-processed nodes.
[0178] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0179] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to the various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0180] The units involved in the embodiments described in the present disclosure can be implemented by software or by hardware. The described units can also be set in a processor. For example, they can be described as: a processor including an acquisition unit, a scoring unit, a determination unit, and a obtaining unit. Among them, the names of these units do not constitute a limitation of the unit itself under certain circumstances. For example, the acquisition unit can also be described as a unit "configured to obtain graph structure data, the graph structure data including: characteristics of the initial nodes and the structural relationship between each initial node".
[0181] The above description is merely a preferred embodiment of the present disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also encompass other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by mutually replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.
Claims
1. A graph pooling method, comprising: Acquiring graph structure data based on a graph structure data acquisition device and a graph convolutional neural network, the graph structure data including: features of initial nodes and structural relationships between the initial nodes; wherein the graph structure data is obtained based on abstraction of commodity attributes or based on abstraction of biological molecular structures, the features of the initial nodes are used to characterize at least one of the position, type, and size of objects in the graph structure data, and the structural relationships between the initial nodes are used to characterize the positional relationships and / or dependency relationships between the initial nodes; Using a neural network model to score the importance of features of each initial node in the graph structure data to obtain a multi-dimensional score vector for each initial node; Determine nodes to be processed based on all initial nodes and the score vectors of each initial node, where the number of nodes to be processed is less than or equal to the number of initial nodes; Based on the characteristics of the nodes to be processed and the structural relationship between each of the nodes to be processed, a representation of the graph structure data is obtained; based on the representation of the graph structure data, a biological molecule property type is obtained or a retrieved product; wherein, the representation of the graph structure data is used to obtain a classification result of the graph structure data, and the classification result includes at least one of the type, property and style of the graph structure data.
2. The method according to claim 1, wherein The importance scoring of the features of each initial node in the graph structure data to obtain a multi-dimensional score vector of each initial node includes: Use multi-dimensional vectors to represent the features of all initial nodes; The importance of the features of each initial node is scored to obtain a multi-dimensional score vector of each initial node.
3. The method according to claim 1, wherein The determining of the node to be processed based on all initial nodes and the score vector of each initial node includes: Randomly discard a set number of initial nodes from all initial nodes to obtain the remaining nodes; Based on the score vectors of the respective initial nodes in the remaining nodes, at least one initial node in the remaining nodes is selected as a node to be processed.
4. The method according to any one of claims 1 to 3, further comprising: Regularization processing is performed on the score vector of the node to be processed to obtain the score vector of the node to be processed, and the regularization processing includes: calculating an absolute value or calculating a square.
5. A classification model training method, the method comprising: Acquire a training data set, wherein the training data set includes at least one sample graph structure data, wherein the sample graph structure data includes: features of initial nodes and structural relationships between initial nodes; Obtaining a pre-established classification network, the classification network comprising: a graph pooling module and a classification module, the graph pooling module being configured to perform the graph pooling method of any one of claims 1 to 4 on graph structure data to obtain a representation of the graph structure data, and the classification module obtaining a classification result of the graph structure data based on the representation of the graph structure data; Perform the following training steps: The sample graph structure data selected from the training data set is input into the classification network, and the loss value of the classification network is calculated; based on the loss value and the classification network, a classification model is obtained.
6. A reconstruction model training method, the method comprising: Acquire a training data set, wherein the training data set includes at least one sample graph structure data, wherein the sample graph structure data includes: features of initial nodes and structural relationships between initial nodes; Obtain a pre-established reconstruction network, the reconstruction network comprising: a graph pooling module and a reconstruction module, the graph pooling module being configured to perform the graph pooling method of any one of claims 1 to 4 on graph structure data to obtain a representation of the graph structure data, and the reconstruction module obtaining reconstructed data of the graph structure data based on the representation of the graph structure data; Perform the following training steps: The sample graph structure data selected from the training data set is input into the reconstruction network, and the loss value of the reconstruction network is calculated; based on the loss value and the reconstruction network, a reconstruction model is obtained.
7. A method for classifying graph structured data, the method comprising: Acquire graph structure data to be classified, wherein the graph structure data to be classified includes: features of initial nodes and structural relationships between initial nodes; The graph structure data to be classified is input into a graph structure data classification model generated by the method according to claim 5, and a classification result of the graph structure data to be classified is output.
8. A method for reconstructing graph structure data, the method comprising: Acquire graph structure data to be reconstructed, wherein the graph structure data to be reconstructed includes: features of initial nodes and structural relationships between initial nodes; The graph structure data to be reconstructed is input into a reconstruction model generated by the method according to claim 6, and reconstruction data of the graph structure data to be reconstructed is output.
9. A graph pooling device, comprising: an acquisition unit configured to acquire graph structure data based on a graph structure data acquisition device and a graph convolutional neural network, the graph structure data including: features of initial nodes and structural relationships between initial nodes; wherein the graph structure data is obtained based on abstraction of commodity attributes or based on abstraction of biomolecule structures, the features of the initial nodes are used to characterize at least one of the position, type, and size of objects in the graph structure data, and the structural relationships between the initial nodes are used to characterize positional relationships and / or dependency relationships between the initial nodes; a scoring unit configured to use a neural network model to score the importance of features of each initial node in the graph structure data to obtain a multi-dimensional score vector for each initial node; a determining unit configured to determine nodes to be processed based on all initial nodes and the score vectors of the initial nodes, wherein the number of the nodes to be processed is less than or equal to the number of the initial nodes; The obtaining unit is configured to obtain a representation of the graph structure data based on the characteristics of the nodes to be processed and the structural relationship between each of the nodes to be processed; obtain a biological molecule property type or retrieve a product based on the representation of the graph structure data; wherein the representation of the graph structure data is used to obtain a classification result of the graph structure data, and the classification result includes at least one of the type, property and style of the graph structure data.
10. A classification model training device, comprising: A sample acquisition unit is configured to acquire a training data set, wherein the training data set includes at least one sample graph structure data, and the sample graph structure data includes: features of initial nodes and structural relationships between initial nodes; A classification network unit is configured to obtain a pre-established classification network, the classification network comprising: a graph pooling module and a classification module, the graph pooling module is configured to perform the graph pooling method according to any one of claims 1 to 4 on graph structure data to obtain a representation of the graph structure data, and the classification module obtains a classification result of the graph structure data based on the representation of the graph structure data; a computing unit configured to input sample graph structure data selected from the training data set into the classification network and calculate a loss value of the classification network; The obtaining unit is configured to obtain a classification model based on the loss value and the classification network.
11. A reconstruction model training device, comprising: A sample acquisition unit is configured to acquire a training data set, wherein the training data set includes at least one sample graph structure data, and the sample graph structure data includes: features of initial nodes and structural relationships between initial nodes; A reconstruction network unit is configured to obtain a pre-established reconstruction network, the reconstruction network comprising: a graph pooling module and a reconstruction module, the graph pooling module is configured to perform the graph pooling method according to any one of claims 1 to 4 on graph structure data to obtain a representation of the graph structure data, and the reconstruction module obtains reconstructed data of the graph structure data based on the representation of the graph structure data; A calculation unit is configured to input sample graph structure data selected from the training data set into the reconstruction network and calculate a loss value of the reconstruction network; The obtaining unit is configured to obtain a reconstruction model based on the loss value and the reconstruction network.
12. A graph structure data classification device, comprising: The structure acquisition unit is configured to acquire the graph structure data to be classified, wherein the graph structure data to be classified includes: features of initial nodes and structural relationships between initial nodes; The classification output unit is configured to input the graph structure to be classified into a classification model generated by the device according to claim 10, and output a classification result of the graph structure data to be classified.
13. A graph structure data reconstruction device, comprising: A structure acquisition unit is configured to acquire graph structure data to be reconstructed, wherein the graph structure data to be reconstructed includes: features of initial nodes and structural relationships between initial nodes; The image output unit is configured to input the graph structure data to be reconstructed into a reconstruction model generated by the apparatus according to claim 11, and output reconstructed data of the graph structure data to be reconstructed.
14. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
15. A computer-readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
16. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Retrieval method and device for same commodities in video
CN106021575A
Graph pooling method based on multi-channel mechanism
CN112508181A