Graph structure data processing method, system and device
By collaborative graph structure learning and node attribute reconstruction, and using a pre-trained structure learner and graph autoencoder, we optimize denoising and generate reliable graph representations, solving the robust modeling problem under the coexistence of graph structure noise and attribute missingness, and achieving more accurate graph representation learning.
Patent Information
- Application Number
- CN202511735183.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies cannot achieve robust modeling in scenarios where graph structure noise and attribute missingness coexist, leading to performance degradation of graph structure learning and node attribute interpolation methods.
By employing collaborative graph structure learning and node attribute reconstruction, a pre-trained structure learner and graph autoencoder are used to optimize denoising and generate reliable graph representations.
In scenarios where graph structure noise and attribute loss coexist, more robust and accurate graph representation learning results are achieved.
Smart Images

Figure CN121636759A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, and in particular to a graph structure data processing method, system and device. BACKGROUND
[0002] Graph structure data is widely used in social networks, recommendation systems, and information security, and its analysis accuracy is crucial. However, real-world graph structure data often contains noisy edges and missing node attributes, posing a serious challenge to reliable knowledge discovery.
[0003] Existing technologies mainly include graph structure learning, graph node attribute interpolation, and incomplete graph learning methods. Graph structure learning methods rely on observed graph structures as supervisory signals to learn the underlying structure, but they are difficult to handle structural noise. Attribute interpolation methods use graph structures to infer missing attributes, but their effectiveness is directly affected by the quality of the structure. When the graph structure contains noise or attributes are incomplete, the above methods often introduce bias from noisy edges or inaccurate interpolation, resulting in performance degradation.
[0004] Therefore, existing technologies cannot handle structural noise and attribute missing simultaneously, and often deal with one defect in isolation. Under the influence of structural noise, existing graph structure learning methods tend to learn suboptimal topology; attribute interpolation based on noisy structures will propagate false information. Therefore, existing technologies cannot achieve robust modeling in scenarios where both structure and attribute information are unreliable. SUMMARY
[0005] Therefore, the embodiments of the present application aim to provide a graph structure data processing method, system and device, which can simultaneously achieve optimal denoising of graph structure and reliable generation of node attributes in scenarios where graph structure noise and attribute missing coexist, thereby obtaining more robust and accurate graph representation learning results.
[0006] In a first aspect, the embodiments of the present application provide a graph structure data processing method, which comprises: obtaining original graph data, the original graph data comprising a first graph structure and a first attribute matrix, the first graph structure comprising a node set and a first edge set; obtaining an intermediate edge set according to the first graph structure and the first attribute matrix by using a pre-trained structure learner; obtaining a second edge set according to the first edge set and the intermediate edge set; obtaining a second attribute matrix according to the second edge set and the first attribute matrix by using a pre-trained graph autoencoder; generate target graph data according to the node set, the second edge set and the second attribute matrix, the target graph data comprising a second graph structure and the second attribute matrix, the second graph structure comprising the node set and the second edge set.
[0007] In a second aspect, an embodiment of the present application provides a graph structure data processing system, the system comprising: a graph structure reconstruction module configured to obtain original graph data, the original graph data comprising a first graph structure and a first attribute matrix, the first graph structure comprising a node set and a first edge set, obtain an intermediate edge set according to the first graph structure and the first attribute matrix by using a pre-trained structure learner, and obtain a second edge set according to the first edge set and the intermediate edge set; an attribute reconstruction module configured to obtain a second attribute matrix according to the second edge set and the first attribute matrix by using a pre-trained graph autoencoder, and generate target graph data according to the node set, the second edge set and the second attribute matrix, the target graph data comprising a second graph structure and the second attribute matrix, the second graph structure comprising the node set and the second edge set.
[0008] In a third aspect, an embodiment of the present application provides a graph structure data processing apparatus, the apparatus comprising: an original graph data obtaining unit configured to obtain original graph data, the original graph data comprising a first graph structure and a first attribute matrix, the first graph structure comprising a node set and a first edge set; an intermediate edge set obtaining unit configured to obtain an intermediate edge set according to the first graph structure and the first attribute matrix by using a pre-trained structure learner; a second edge set obtaining unit configured to obtain a second edge set according to the first edge set and the intermediate edge set; a second attribute matrix obtaining unit configured to obtain a second attribute matrix according to the second edge set and the first attribute matrix by using a pre-trained graph autoencoder; a target graph data obtaining unit configured to generate target graph data according to the node set, the second edge set and the second attribute matrix, the target graph data comprising a second graph structure and the second attribute matrix, the second graph structure comprising the node set and the second edge set.
[0009] In a fourth aspect, an embodiment of the present application provides an electronic device comprising a memory and a processor, the memory being configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to the first aspect.
[0010] Fifthly, embodiments of the present invention provide a computer program product comprising a computer program, wherein when the computer program is run on a computer, the computer performs the method described in the first aspect above.
[0011] In a sixth aspect, embodiments of the present invention provide a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the method described in the first aspect.
[0012] The technical solution of this invention acquires original graph data including a first graph structure and a first attribute matrix. The first graph structure includes a set of nodes and a set of edges. A pre-trained structure learner obtains a set of intermediate edges based on the first graph structure and the first attribute matrix. A second set of edges is obtained based on the first set of edges and the set of intermediate edges. A pre-trained graph autoencoder obtains a second attribute matrix based on the second set of edges and the first attribute matrix. Target graph data is generated based on the set of nodes, the second set of edges, and the second attribute matrix. Therefore, even in scenarios where graph structure noise and attribute deficiencies coexist, collaborative graph structure learning and node attribute reconstruction simultaneously achieve graph structure optimization and denoising, as well as reliable generation of node attributes, resulting in more robust and accurate graph representation learning results. Attached Figure Description
[0013] The above and other objects, features and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which: Figure 1 This is a schematic diagram of a graph structure data processing system according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the graph data in an embodiment of the present invention; Figure 3 This is a schematic diagram of a graph-structured data processing system according to another embodiment of the present invention; Figure 4 This is a schematic diagram of the training structure learner according to an embodiment of the present invention; Figure 5 This is a flowchart of the training structure learner according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a training graph autoencoder according to an embodiment of the present invention; Figure 7 This is a flowchart of the training graph autoencoder according to an embodiment of the present invention; Figure 8 This is a flowchart of the encoder fine-tuning process according to an embodiment of the present invention; Figure 9 This is a flowchart of a graph structure data processing method according to an embodiment of the present invention; Figure 10This is a flowchart of obtaining the intermediate edge set according to an embodiment of the present invention; Figure 11 This is a flowchart of an embodiment of the present invention for obtaining a second edge set based on a first edge set and a middle edge set; Figure 12 This is a flowchart of obtaining the second side set according to an embodiment of the present invention; Figure 13 This is a flowchart of obtaining the second attribute matrix according to an embodiment of the present invention; Figure 14 This is a schematic diagram of a graph structure data processing device according to an embodiment of the present invention; Figure 15 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0014] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the substance of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.
[0015] Furthermore, those skilled in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.
[0016] Unless the context explicitly requires it, words such as "including" or "contains" throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".
[0017] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0018] The solutions described in this specification and embodiments, if involving the processing of personal information, will be processed only on the premise of having a legal basis (such as obtaining the consent of the personal information subject, or being necessary for the performance of a contract), and will only be processed within the scope stipulated or agreed upon. A user's refusal to process personal information beyond what is necessary for basic functions will not affect the user's use of basic functions.
[0019] Graph data (or graph-structured data), as an important form of data representation, has been widely used in several key areas such as social network analysis, recommender systems, and fraud detection. Graph Neural Networks (GNNs), as a core tool for processing graph-structured data, aggregate neighbor node information through message passing mechanisms, effectively capturing complex dependencies in the graph and thus demonstrating excellent performance in tasks such as node classification and link prediction. Especially in fraud detection scenarios, GNN-based models, by analyzing user interaction graphs (where nodes represent users and edges represent interaction relationships) to identify potential fraudulent behavior, have become an indispensable technical means in financial, e-commerce, and content security platforms.
[0020] However, these GNN-based fraud detection models are particularly vulnerable to strategies employed by fraudsters to evade detection. Most traditional GNN models rely on message passing mechanisms, where graph structure and node attributes are crucial to model effectiveness. Therefore, fraudsters may weaken the performance of GNN-based fraud detection models by perturbing edges and attributes. Regarding edge perturbation, a common approach is to establish connections with legitimate users. By doing so, information about legitimate users can be propagated to the fraudster through the injected edges, making it harder for the GNN-based model to distinguish them from legitimate users. Regarding node attribute perturbation, a common strategy is to remain silent, i.e., generating low-quality initial embeddings by providing as little valuable information as possible to conceal fraudulent intent. These behaviors lead to structural noise and missing node attributes in the graph data.
[0021] Currently, research on the problem of incomplete graph data mainly focuses on three directions: Graph Structure Learning (GSL), graph node attribute imputation, and incomplete graph learning. Although these methods have made some progress under their respective settings, they all have fundamental limitations when dealing with GNA data. GSL methods heavily rely on observed graph structure as a supervisory signal, assuming that edge information is basically reliable. However, in GNA scenarios, noisy edges can mislead the structure learning process, causing the learned graph topology to fail to reflect the true relationships, or even amplifying structural biases. Attribute imputation methods rely on graph structure to infer missing values. When noisy edges exist in the graph, the imputation process introduces incorrect information from irrelevant neighbors, causing attribute contamination. Incomplete graph learning methods typically assume a relatively complete graph structure, making it difficult to achieve effective modeling when edge noise and attribute missingness coexist. Existing technologies fail to coordinate the coupling effect of structural noise and attribute missingness; instead, due to their reliance on unreliable structural or attribute information, they create error propagation and amplification mechanisms.
[0022] Therefore, this invention proposes a graph structure data processing method, system, and apparatus that can simultaneously optimize and denoise the graph structure and reliably generate node attributes in scenarios where graph structure noise and attribute loss coexist. This can achieve more robust and accurate graph representation learning results by collaboratively learning the graph structure and reconstructing node attributes.
[0023] Figure 1 This is a schematic diagram of a graph-structured data processing system according to an embodiment of the present invention. Figure 1 As shown, graph structure data processing system B updates the original graph data A1 to obtain the target graph data A2.
[0024] Graph data is a data format that represents data as entities (called nodes) and the relationships between entities (called edges). Graph data includes both the attributes of the nodes themselves and the connections between nodes.
[0025] Furthermore, the graph data includes a graph structure and node attributes. The graph structure includes a set of nodes and a set of edges.
[0026] A graph structure G can be represented as G = (V, E), where V is the set of nodes and E is the set of edges. The set of nodes V and the set of edges E together define the topological structure of the graph.
[0027] A node set V is the collection of all nodes (entities or objects) in a graph structure. For example, in a social network, each node can be a user.
[0028] Edge set E is a set of relationships between nodes in a graph structure. Edge set E includes multiple edges, each connecting two nodes (or a node pair), indicating a specific association between the two nodes. Edges can be directed or undirected, and each edge in edge set E can be associated with an edge weight to quantify the strength of the connection. The embodiments of this invention are illustrated using an undirected graph as an example; directed graphs can be implemented based on the same principle.
[0029] In some embodiments, the edge set E also includes the weights of each edge, referred to as edge weights. Edge weights are numerical attributes of edges in the graph, representing the strength or importance of the connection between two nodes. Edge weights can be represented in different ways depending on the application scenario of the graph data.
[0030] For example, in scenarios such as social networks, a binary representation can be used, with edge weights of 0 or 1, where 0 indicates no association and 1 indicates association.
[0031] For example, in scenarios such as recommendation systems, edge weights can be represented by probabilities, with the weights ranging from [0,1] to represent the connection strength, confidence, or probability between two nodes.
[0032] For example, in scenarios such as communication networks, frequency can be used to represent information such as interaction frequency and number of collaborations, with edge weights of 5, 15, 20, etc.
[0033] Node attributes describe the unique features and information of each node, providing rich semantic content for the entities in the graph. Each node possesses an attribute vector containing multiple features describing that node. The attribute vectors of all nodes together form the node attribute matrix X in the graph structure data. If the graph structure has N nodes, and each node has D-dimensional features, then the node attribute matrix X has dimensions N×D.
[0034] Figure 2 This is a schematic diagram of the graph data in an embodiment of the present invention. Figure 2 In the data shown in the graph: The node set V is {1, 2, 3, 4, 5, 6, 7}, indicating that the graph data includes 7 nodes.
[0035] The edge set E is {(1,2), (1,7), (2,1), (2,3), (2,6), (3,2), (3,4), (4,3), (4,5), (5,4), (5,6), (6,2), (6,5), (6,7), (7,1), (7,6)}.
[0036] In addition, each node has corresponding attributes. Figure 2 In the illustrated embodiment, each node includes three attributes as an example. Of all the attributes of each node, all attributes may already exist (pre-obtained), all attributes may not exist (not pre-obtained), or some attributes may exist while others do not. In this embodiment, existing attributes are referred to as observed attributes, and non-existent attributes are referred to as missing attributes.
[0037] For example, for node 1, the first attribute is the missing attribute, and the second and third attributes are the observed attributes; for node 2, the first attribute is the observed attribute, and the second and third attributes are the missing attributes, and so on.
[0038] However, the original graph data may contain noisy structures and missing graph node attributes. Noisy structures refer to erroneous edges in the graph structure, which may be caused by data acquisition errors, attackers forging connections, or other factors. For example, in... Figure 2In the graph data shown, if node 1 and node 7 are actually unrelated (or only slightly related), but a connection is established between them in the graph structure for various reasons, then this edge is considered noise. Missing node attributes refer to the absence of attribute information for nodes in the graph. This may be due to incomplete data collection, privacy protection, or deliberate concealment of information by attackers. For example, Figure 2 The first attribute of node 1 in the graph is a missing attribute. Therefore, in order to make the downstream task processing results more accurate, the graph structure and node attributes need to be reconstructed.
[0039] The graph structure data processing system B is used to reconstruct the original graph data A1 to obtain the target graph data A2. The graph structure data processing system B includes a graph structure reconstruction module B1 and an attribute reconstruction module B2.
[0040] Among them, the graph structure reconstruction module B1 is used to reconstruct the graph structure. Specifically, it generates a second graph structure based on the first graph structure and the first attribute matrix.
[0041] The attribute reconstruction module B2 is used to reconstruct attributes. Specifically, it generates a second attribute matrix based on the second graph structure and the first attribute matrix.
[0042] Finally, the second graph structure and the second attribute matrix are combined into the target graph data to achieve graph data reconstruction.
[0043] Specifically, Figure 3 This is a schematic diagram of a graph-structured data processing system according to another embodiment of the present invention. Figure 3 The specific architecture and data processing flow of the system are illustrated. Specifically, the graph structure data processing system B includes a graph structure reconstruction module B1 and an attribute reconstruction module B2. The graph structure reconstruction module B1 includes a structure learner B11. The attribute reconstruction module B2 includes a graph autoencoder B21.
[0044] The graph structure reconstruction module B1 is used to reconstruct the first graph structure to obtain the second graph structure.
[0045] Specifically, the graph structure reconstruction module B1 obtains a set of intermediate edges based on the first graph structure G1 and the first attribute matrix X1 using a pre-trained structure learner B11, obtains a set of second edges based on the first edge set and the set of intermediate edges, and generates a second graph structure based on the second edge set and the node set. The second graph structure includes the second edge set and the node set. The structure learner B11 is a module or method that automatically infers or optimizes the graph structure (i.e., the connection relationships between nodes) from data.
[0046] Figure 4 This is a schematic diagram of the training structure learner according to an embodiment of the present invention. Figure 5This is a flowchart of the training structure learner according to an embodiment of the present invention. (In conjunction with...) Figure 4 and Figure 5 Obtaining a pre-trained structure learner involves the following steps: Step S110: Obtain the first sample image data.
[0047] In this embodiment, a first sample graph data AS1 is obtained. The first sample graph data AS1 includes a first sample graph structure GS1 and a first sample attribute matrix XS1. The first sample graph structure GS1 includes a first sample node set and a first sample edge set.
[0048] The first sample graph data and the original graph data can be the same graph data or different graph data.
[0049] When the first sample graph data and the original graph data are the same graph data, the processing procedure of this embodiment of the invention is as follows: First, the structure learner is trained based on the original graph data. After training, the pre-trained structure learner is used to reconstruct the graph structure of the original graph data. When the first sample graph data and the original graph data are not the same graph data, the processing procedure of this embodiment of the invention is as follows: First, the structure learner is trained based on the first sample graph data. After training, the pre-trained structure learner is used to reconstruct the graph structure of the original graph data.
[0050] Step S120: Sample the first sample graph data to obtain multiple sub-graph data.
[0051] In this embodiment, in noisy graph data, connected node pairs may be noisy edges, and directly using them for supervised learning may introduce bias. In contrast, unconnected node pairs typically remain unconnected in noisy graph structures. Although some of these unconnected node pairs may be potential edges (i.e., originally connected but missed due to data acquisition errors), their impact is negligible compared to the vast number of truly unconnected node pairs (given the inherent sparsity of graph data). Even if all connected edges are considered potential edges, the number of truly unconnected edges is still far greater than the number of potential edges. Therefore, this embodiment of the invention focuses on utilizing a large number of reliable unconnected node pairs for graph structure learning.
[0052] Specifically, firstly, connected node pairs and unconnected node pairs are determined based on the data from the first sample graph. Figure 4 In the illustrated embodiment, graph structure GS1 shows a schematic diagram of connected node pairs, where two nodes connected by a solid line constitute a connected node pair; graph structure GS2 shows a schematic diagram of unconnected node pairs, where two nodes connected by a dashed line constitute an unconnected node pair. For any two nodes, if these two nodes are not connected in the first sample graph structure, then these two nodes are an unconnected node pair.
[0053] Then, a dilution ratio r is set according to the actual application scenario. The dilution ratio is a pre-set ratio of unconnected node pairs to connected node pairs. Based on the predetermined dilution ratio r, a first number of unconnected node pairs are randomly sampled, and a second number of connected node pairs are randomly sampled, where r is equal to the ratio of the first number to the second number. Thus, a set of node pairs can be obtained. This sampling process is repeated T times to obtain T sets of node pairs.
[0054] like Figure 4 As shown, the first sampled set of node pairs F1 includes four connected node pairs and eight unconnected node pairs. The four connected node pairs are (3,4), (1,7), (5,6), and (2,6); the eight unconnected node pairs are (1,3), (4,7)...(7,3), and their corresponding structure is GS3.
[0055] The node pair set FT of the Tth sampling also includes four connected node pairs and eight unconnected node pairs. The four connected node pairs are (3,4), (2,3), (2,6), and (6,7); the eight unconnected node pairs are (1,3), (4,7)...(7,3), and their corresponding structure is GS4.
[0056] Next, based on the sampled nodes, corresponding subgraph data is generated for the set. The subgraph data includes a subgraph structure and a sub-attribute matrix. The subgraph structure includes a set of child nodes and a set of child edges. Specifically, the set of child nodes is the set of sampled nodes, the set of child edges includes the edges of the sampled nodes, and the sub-attribute matrix includes the attributes of each node in the set of child nodes.
[0057] Step S130: Obtain the predicted edge weights of each node pair in the subgraph data using the structure learner based on the sub-attribute matrix.
[0058] In this embodiment, for nodes u and v, the structure learner can calculate the predicted edge weights for each pair of nodes in the subgraph data using the following formula:
[0059] in, Let represent the predicted edge weights of nodes u and v, and m be the number of learnable weight vectors in the structure learner. This represents the i-th weight vector. Let be the attribute vector of node u. Let v be the attribute vector of node v. Here, denoted as Hadamard product, and cos represents the calculation of cosine similarity.
[0060] Furthermore, in this embodiment of the invention, the attribute vector used to calculate the predicted edge weights is the observed attribute vector. For a node pair, node u and node v, if node u and / or node v have both observed and missing attributes, the cosine similarity between the two nodes can be calculated using the paired observed attributes. That is, the observed attributes of node u and node v are obtained. If the observed attributes of nodes u and v have at least one common non-missing dimension (i.e., both have observed attributes in that dimension), the cosine similarity is calculated based on these commonly observed dimensions. The similarity of each attribute dimension can be calculated first using the above formula, and then the predicted edge weights are calculated by weighting or averaging the similarities of each attribute dimension. If there are no common non-missing dimensions, the similarity cannot be reliably calculated, and the predicted edge weights can be set to 0.
[0061] For example, for nodes 3 and 4, the second attribute of node 3 is a missing attribute, and the first and third attributes are observed attributes; the first attribute of node 4 is a missing attribute, and the second and third attributes are observed attributes. That is, the third attribute is a common non-missing dimension that exists in nodes 3 and 4. Therefore, the similarity of the third attribute is the predicted edge weight of nodes 3 and 4.
[0062] For example, for nodes 4 and 6, the first attribute of node 4 is the missing attribute, and the second and third attributes are the observed attributes; the first attribute of node 6 is the missing attribute, and the second and third attributes are the observed attributes. That is, the second and third attributes are two common non-missing dimensions of nodes 4 and 6. Therefore, the average similarity of the second and third attributes is the predicted edge weight of nodes 4 and 6.
[0063] For example, for nodes 2 and 4, the second and third attributes of node 2 are missing attributes, and the first attribute is an observed attribute; the first attribute of node 4 is a missing attribute, and the second and third attributes are observed attributes; that is, there is no common non-missing dimension between nodes 2 and 4. Therefore, the prediction edge weights of nodes 2 and 4 are set to 0.
[0064] It should be noted that in the process of calculating the predicted edge weights for each node pair in this embodiment of the invention, the node pairs being considered are sampled node pairs (including connected node pairs and unconnected node pairs). If two nodes in the subgraph data are neither a sampled connected node pair nor a sampled unconnected node pair, then it is not necessary to calculate the predicted edge weights. For example, taking... Figure 4Taking the first sampling in the graph as an example, during the sampling process, four connected node pairs and eight unconnected node pairs were sampled, for a total of twelve node pairs. Therefore, it is only necessary to calculate the set of predicted edge weights for these twelve node pairs. For other possible node pairs in the graph, such as (1,6) and (1,2), it is not necessary to calculate the predicted edge weights.
[0065] Step S140: Calculate the first loss value corresponding to each subgraph data based on the predicted edge weights and the actual edge weights in the sub-edge set.
[0066] In this embodiment, based on a predetermined loss function, the first loss value corresponding to each subgraph data is calculated according to the predicted edge weights and the actual edge weights in the sub-edge set.
[0067] The formula for calculating the first loss value is as follows:
[0068] in, Let be the first loss value, n be the total number of node pairs sampled in the subgraph data, and S be the set of node pairs sampled in the subgraph data. Let u and v be the actual edge weights. Let be the predicted edge weights for nodes u and v.
[0069] The actual edge weight is either 0 or 1. If node u and node v are a connected node pair, then... If node u and node v are an unconnected node pair, then .
[0070] Therefore, the first loss value corresponding to a subgraph data can be calculated through the above process. By performing the above process for each subgraph data, the first loss value corresponding to each subgraph data can be obtained.
[0071] Step S150: Calculate the total loss value based on the first loss value corresponding to each subgraph data.
[0072] In this embodiment, the formula for calculating the total loss value is as follows:
[0073] in, The total loss value is T, where T is the number of subplot data points. Let be the first loss value corresponding to the i-th subgraph data.
[0074] Step S160: Optimize the structure learner based on the total loss value to obtain the pre-trained structure learner.
[0075] In this embodiment, the learnable weight vector of the structure learner is optimized by minimizing the total loss value to obtain the pre-trained structure learner.
[0076] Therefore, by randomly sampling a large number of unconnected node pairs and appropriately sampling connected node pairs, multiple subgraph data are constructed as supervision signals for structure learning. This approach can reduce the proportion of noisy node pairs, thereby diluting the impact of noisy edges on graph structure learning.
[0077] Furthermore, the attribute reconstruction module B2 is used to reconstruct the first attribute matrix to obtain the second attribute matrix. The attribute reconstruction module B2 includes a pre-trained graph autoencoder B21. The graph autoencoder B21 includes an encoder B211 and a decoder B212.
[0078] Figure 6 This is a schematic diagram of a training graph autoencoder according to an embodiment of the present invention. Figure 7 This is a flowchart of a training graph autoencoder according to an embodiment of the present invention. (Combined with...) Figure 6 and Figure 7 Obtaining a pre-trained structure learner involves the following steps: Step S210: Obtain the second sample image data.
[0079] In this embodiment, the second sample graph data AS2 is obtained. The second sample graph data AS2 includes the second sample graph structure GS5 and the second sample attribute matrix XS2. The second sample graph structure GS5 includes the second sample node set and the second sample edge set.
[0080] The second sample graph data used to train the graph autoencoder and the first sample graph data used to train the structure learner can be the same graph data or different graph data.
[0081] Step S220: Use a predetermined interpolation algorithm to interpolate missing attributes for nodes with missing attributes based on the second sample attribute matrix to obtain an intermediate attribute matrix.
[0082] In this embodiment, nodes with missing attributes in the second sample graph data are obtained, and a predetermined interpolation algorithm is used to interpolate the missing attributes of the nodes with missing attributes according to the second sample attribute matrix to obtain an intermediate attribute matrix Xm.
[0083] In some embodiments, the predetermined interpolation algorithm is the k-nearest neighbor mean algorithm. Specifically, for a node v with a missing attribute... i compute node v i Based on the similarity with all other nodes in the graph structure, select the top-k nodes (i.e., those similar to node v). i(Rank the top k nodes by similarity). Among the selected nodes, collect the non-missing values of this dimension and calculate the average of the collected values as the imputation value.
[0084] It should be noted that, Figure 6 In the illustrated embodiment, for ease of explanation, processing all nodes in the sample graph data is taken as an example. However, in actual operation, a predetermined number of nodes can be randomly sampled from the second sample node set. The predetermined number can be preset according to the actual application scenario, and the sampling method can be implemented based on various existing methods. Then, the sampled nodes can be processed.
[0085] Step S230: The encoder obtains the learned node embedding vector based on the second sample graph structure and the intermediate attribute matrix.
[0086] In this embodiment, the second sample graph structure GS5 and the intermediate attribute matrix Xm are input into the encoder B211 together. The encoder B211 obtains the learned node embedding vector based on the second sample graph structure and the intermediate attribute matrix.
[0087] Specifically, the encoder B211 is used to map nodes into low-dimensional vectors (node embedding vectors) that should capture the node's own properties and its structural role in the graph.
[0088] Wherein, node embedding vector .
[0089] In other words, the encoder's input is the intermediate attribute matrix Xm and the second sample graph structure GS5, and its output is the node embedding vector Z.
[0090] More specifically, for the input second sample graph structure GS5, embodiments of the present invention can convert it into an adjacency matrix before input, so as to... Figure 6 Taking the second sample graph structure GS5 as an example, the adjacency matrix of 7 nodes can be represented as a 7*7 matrix, as follows:
[0091] Here, 1 indicates that the two nodes are connected, and 0 indicates that the two nodes are not connected.
[0092] That is, the formula for calculating the node embedding vector can also be expressed as: .
[0093] The specific implementation principle of the encoder can be implemented based on various existing methods, and the embodiments of the present invention do not limit this. For example, the encoder can be implemented by a graph convolutional network (GCN).
[0094] Step S240: The decoder generates a prediction attribute matrix based on the second sample graph structure and the node embedding vector.
[0095] In this embodiment, decoder B212 is used to generate a predicted attribute matrix based on the second sample edge set and the node embedding vector. Specifically, decoder B212 is used to map the node embedding vector back to the original attribute space.
[0096] Among them, the prediction attribute matrix .
[0097] In some embodiments, decoder B212 can be implemented using a graph convolutional decoder (GCN-based decoder), including an MLP (Multilayer Perceptron) decoder and a graph convolutional layer. The MLP decoder obtains a preliminary reconstructed attribute matrix based on the node embedding vector Z, and then the graph convolutional layer fuses neighbor information into the preliminary reconstructed attribute matrix based on a second sample graph structure to obtain a predicted attribute matrix. Specifically, first, the structure of the MLP decoder is designed. For example, the MLP decoder includes an input layer, one or more hidden layers, and an output layer. The dimension of the input data in the input layer is equal to the dimension of the node embedding vector Z; the dimension of the one or more hidden layers is h, which can use ReLU activation; the dimension of the output layer is D, the same as the original attribute dimension. The node embedding vector Z is input into the MLP decoder, which calculates the preliminary reconstructed attribute matrix layer by layer, and then the graph convolutional layer fuses neighbor information into the preliminary reconstructed attribute matrix based on a second sample graph structure to obtain the predicted attribute matrix.
[0098] More specifically, for the input second sample graph structure GS5, embodiments of the present invention can convert it into an adjacency matrix before input, so as to... Figure 6 Taking the second sample graph structure GS5 as an example, the adjacency matrix of 7 nodes can be represented as a 7*7 matrix, as follows:
[0099] Here, 1 indicates that the two nodes are connected, and 0 indicates that the two nodes are not connected.
[0100] That is, the formula for calculating the prediction attribute matrix can also be expressed as: .
[0101] Step S250: Calculate the second loss value based on the predicted attribute matrix and the intermediate attribute matrix.
[0102] In this embodiment, a second loss value is calculated based on the predicted attribute matrix XS4 and the intermediate attribute matrix Xm, wherein the formula for calculating the second loss value is as follows:
[0103] in, This is the second loss value. The number of sample nodes. and For pre-set parameters, Greater than , Indicates the index of the observed attribute. Indicates the index of the interpolation attribute. The actual attribute value of the observed attribute. Predicted attribute values for the observed attributes. To interpolate the actual attribute value, The predicted attribute value for the interpolated attribute. Expressing the request The L2 norm.
[0104] In other words, for all sample nodes, in the predicted attribute matrix, the observed attributes are extracted to obtain XS5, and the unobserved attributes are extracted to obtain XS6; in the intermediate attribute matrix, the observed attributes are extracted to obtain XS8, and the unobserved attributes (impregnation attributes) are extracted to obtain XS7. The differences between attributes with the same index in XS5 and XS8 are calculated, and the L2 norm is calculated to obtain the relevant parameters of the observed attributes; the differences between attributes with the same index in XS6 and XS7 are calculated, and the L2 norm is calculated to obtain the relevant parameters of the unobserved attributes; then, using pre-set parameters... and The weighted sum of the relevant parameters of the observed attributes and the relevant parameters of the unobserved attributes is divided by the total number of sample nodes to obtain the second loss value.
[0105] Step S260: Optimize the encoder and decoder according to the second loss value to obtain the pre-trained graph autoencoder.
[0106] In this embodiment, the encoder and decoder are optimized by minimizing the second loss value to obtain the pre-trained graph autoencoder.
[0107] In some embodiments, obtaining a pre-trained structure learner further includes the following steps: Step S270: Fine-tune the encoder based on the tag sample nodes.
[0108] Specifically, Figure 8 This is a flowchart illustrating the fine-tuning of the encoder according to an embodiment of the present invention. Figure 8 As shown, fine-tuning the encoder based on the label sample nodes includes the following steps: Step S271: Obtain the label sample node.
[0109] In this embodiment, tagged sample nodes are obtained, which are sample nodes with tags. The tag represents the node's category. For example, in a fraud detection scenario, the tag could be "normal user" or "fraudster."
[0110] This embodiment of the invention uses the acquisition of labeled sample nodes from the second sample graph data AS2 as an example. The second sample graph data AS2 includes a second sample graph structure GS5 and a second sample attribute matrix XS2. The second sample graph structure GS5 includes a second sample node set and a second sample edge set. A certain number of nodes are sampled from the second sample node set, and labels are added to the sampled nodes to obtain the labeled sample nodes.
[0111] Step S272: Obtain the node embedding vector of each label sample node through the encoder.
[0112] In this embodiment, the second sample graph structure and the second attribute matrix corresponding to the label sample node are input to the encoder. The encoder obtains the node embedding vector of each label sample node based on the second sample graph structure and the second attribute matrix. The specific working principle of the encoder can be referred to step S230 above, and will not be repeated here.
[0113] Step S273: Obtain the predicted category of the labeled sample node based on the node embedding vector using a linear classifier.
[0114] In this embodiment, the linear classifier is a machine learning model that classifies data based on a linear decision boundary, using a linear function to determine which class a sample belongs to. The linear classifier B22 obtains the predicted class of the labeled sample node based on the node embedding vector.
[0115] Step S274: Calculate the third loss value based on the predicted category and the label category.
[0116] In this embodiment, a third loss value is calculated based on the predicted category and the label category. The formula for calculating the third loss value is as follows:
[0117] in, This is the third loss value. Let be the predicted category of the i-th labeled sample node. Let be the label category of the i-th label sample node. This represents the number of labeled sample nodes.
[0118] Step S275: Fine-tune the encoder according to the third loss value.
[0119] In this embodiment, the encoder is optimized by minimizing the third loss value to achieve fine-tuning of the encoder.
[0120] After obtaining the pre-trained structure learner and graph autoencoder, the graph structure data processing method of this embodiment of the invention can be executed.
[0121] Figure 9 This is a flowchart of a graph structure data processing method according to an embodiment of the present invention. (In conjunction with...) Figure 3 and Figure 9 The graph structure data processing method of this invention includes the following steps: Step S310: Obtain the original graph data.
[0122] In this embodiment, original graph data A1 is obtained, which is the graph data that needs to be reconstructed. Further, the original graph data A1 includes a first graph structure G1 and a first attribute matrix X1. The first graph structure G1 includes a node set and a first edge set, where each edge in the first edge set represents the connection relationship between each node in the node set.
[0123] The first edge set includes the edge weights between any two nodes. If the two nodes are connected, the corresponding edge weight is 1; if the two nodes are not connected, the corresponding edge weight is 0.
[0124] by Figure 3 Taking the first graph structure shown as an example, the set of the first edges of the 7 nodes can be represented as a 7*7 weight matrix, as follows:
[0125] Here, 1 indicates that the two nodes are connected, and 0 indicates that the two nodes are not connected.
[0126] Step S320: Obtain the set of intermediate edges using a pre-trained structure learner based on the first graph structure and the first attribute matrix.
[0127] In this embodiment, the graph structure reconstruction module B1 is used to reconstruct the first graph structure to obtain a second graph structure. Specifically, the graph structure reconstruction module B1 uses a pre-trained structure learner B11 to obtain a set of intermediate edges based on the first graph structure G1 and the first attribute matrix X1, obtains a set of second edges based on the first edge set and the set of intermediate edges, and generates a second graph structure based on the second edge set and the node set. The second graph structure includes a second edge set and a node set.
[0128] Figure 10 This is a flowchart illustrating the process of obtaining the intermediate edge set according to an embodiment of the present invention. For example... Figure 10As shown, obtaining the set of intermediate edges using a pre-trained structure learner based on the first graph structure and the first attribute matrix includes the following steps: Step S321: Obtain the attribute vector of the first node and the attribute vector of the second node based on the first attribute matrix.
[0129] In this embodiment, any two nodes are selected from the node set as a node pair, referred to as the first node and the second node, respectively. That is, the first node and the second node are two nodes in a node pair. The attribute vectors of the first node and the second node are the node attributes observed from the first attribute matrix.
[0130] Step S322: Obtain the set of intermediate edges using a pre-trained structure learner based on the attribute vectors of the first node and the second node.
[0131] In this embodiment, the intermediate edge set includes the edge weights between every two nodes. Specifically, for any two nodes u and v, the edge weights are calculated using the following formula:
[0132] in, Let represent the edge weights of nodes u and v, and m be the number of weight vectors in the structure learner. This represents the i-th weight vector. Let be the attribute vector of node u. Let v be the attribute vector of node v. Here, denoted as Hadamard product, and cos represents the calculation of cosine similarity.
[0133] In this system, one of nodes u and v is the first node, and the other is the second node. That is, when node u is the first node, node v is the second node; and when node v is the first node, node u is the second node.
[0134] Furthermore, in this embodiment of the invention, the attribute vector used to calculate the intermediate edge weight is the observed attribute vector. For a node pair, node u and node v, if node u and / or node v have both observed and missing attributes, the cosine similarity between the two nodes can be calculated using the paired observed attributes. That is, the observed attributes of node u and node v are obtained. If the observed attributes of nodes u and v have at least one common non-missing dimension (i.e., both have observed attributes in that dimension), the cosine similarity is calculated based on these commonly observed dimensions. The similarity of each attribute dimension can be calculated first using the above formula, and then the intermediate edge weight is calculated by weighting or averaging the similarities of each attribute dimension. If there are no common non-missing dimensions, the similarity cannot be reliably calculated, and the intermediate edge weight can be set to 0.
[0135] Thus, we can obtain the intermediate edge set, which includes the edge weight between every two nodes, and the edge weight ranges from [0,1].
[0136] As an example, the set of intermediate edges can be represented as a weight matrix as follows:
[0137] Step S330: Obtain the second edge set based on the first edge set and the intermediate edge set.
[0138] Figure 11 This is a flowchart illustrating how the second edge set is obtained based on the first edge set and the intermediate edge set, according to an embodiment of the present invention. Figure 11 As shown, obtaining the second edge set based on the first edge set and the intermediate edge set includes the following steps: Step S331: Obtain the weight sum from the first edge set and the intermediate edge set.
[0139] In this embodiment, the weights of each edge in the weight matrix P of the first edge set and the weight matrix Q of the middle edge set are added together to obtain the weight sum, which can be represented as the following matrix:
[0140] Each element in the matrix R above is a weighted sum.
[0141] Step S332: Obtain the second edge set based on the weights and the comparison result with the predetermined threshold.
[0142] In this embodiment, the predetermined threshold includes a first threshold and a second threshold. The first threshold is a threshold for original connection types of connected node pairs, and the second threshold is a threshold for original connection types of unconnected node pairs. The first threshold is set to a value greater than 1 and less than 2, such as 1.5 or 1.6. The second threshold is set to a value greater than 0 and less than 1, such as 0.7 or 0.8.
[0143] Specifically, Figure 12 This is a flowchart illustrating the process of obtaining the second side set according to an embodiment of the present invention. For example... Figure 12 As shown, obtaining the second edge set based on the weights and the comparison result with a predetermined threshold includes the following steps: Step S3321: Determine the original connection type of each node pair based on the first edge set.
[0144] In this embodiment, the original connection type of each node pair is determined based on the first edge set. The original connection type includes connected node pairs and unconnected node pairs. If the weight of the first edge of a node pair in the first edge set is 1, the original connection type is a connected node pair; if the weight of the first edge of a node pair in the first edge set is 0, the original connection type is an unconnected node pair.
[0145] Step S3322: In response to the original connection type of the node pair being a connected node pair, the weight sum is compared with the first threshold. In response to the weight sum being greater than or equal to the first threshold, the weight of the second side is set to 1. In response to the weight sum being less than the first threshold, the weight of the second side is set to 0.
[0146] Step S3323: In response to the original connection type of the node pair being an unconnected node pair, the weight sum is compared with the second threshold. In response to the weight sum being greater than or equal to the second threshold, the weight of the second side is set to 1. In response to the weight sum being less than the second threshold, the weight of the second side is set to 0.
[0147] For example, with Figure 3 Taking the first diagram as an example, the connected node pairs include (1,2), (1,7), (2,3), (2,6), (3,4), (4,5), (5,6), and (6,7), while the other node pairs are unconnected node pairs.
[0148] Taking a first threshold of 1.6 and a second threshold of 0.7 as an example, after processing the matrix R through steps S3321-S3323, the resulting set of second edges can be represented as the following weight matrix:
[0149] From the above weight matrix As can be seen, the connection node pairs include (1,2), (1,5), (2,3), (2,6), (3,4), (4,5), (5,6), and (6,7). Compared with the connection node pairs in the first graph structure, node pair (1,7) has been deleted, and node pair (1,5) has been added. Thus, the graph structure can be reconstructed.
[0150] Step S340: Obtain the second attribute matrix using a pre-trained graph autoencoder based on the second edge set and the first attribute matrix.
[0151] in, Figure 13 This is a flowchart illustrating the process of obtaining the second attribute matrix according to an embodiment of the present invention. Figure 13 As shown, the process of obtaining the second attribute matrix using a pre-trained graph autoencoder based on the second edge weights and the first attribute matrix includes the following steps: Step S341: Obtain candidate nodes from the node set, wherein the candidate nodes are nodes with missing attributes.
[0152] In this embodiment, candidate nodes are obtained from the node set, and the candidate nodes are nodes with missing attributes.
[0153] Step S342: Use a predetermined interpolation algorithm to interpolate missing attributes for each candidate node based on the first attribute matrix to obtain an intermediate attribute matrix.
[0154] In this embodiment, the predetermined interpolation algorithm is the k-nearest neighbor mean algorithm. Specifically, for candidate nodes v with missing attributes... i Within its k-hop neighborhood (i.e. from v) i Starting from a node reachable in ≤k steps, find nodes with the attribute value. If k=1, only consider direct neighbors. Suppose we want to impute the j-th dimension attribute, collect the non-missing values of that dimension from all neighbors. If the collected values are not an empty set, calculate the average of the collected values as the imputed value; if the collected values are an empty set, we can increase k and continue collecting.
[0155] Step S343: Obtain the learned node embedding vectors by the encoder based on the second edge set and the intermediate attribute matrix.
[0156] In this embodiment, the second graph structure G2, consisting of the second edge set and the node set, and the intermediate attribute matrix Xm are input into the encoder. The encoder obtains the learned node embedding vector based on the second edge set and the intermediate attribute matrix.
[0157] Step S344: Generate the second attribute matrix using the decoder based on the second edge set and the node embedding vector.
[0158] In this embodiment, the second graph structure G2, consisting of the second edge set and the node set, and the node embedding vector are input into the decoder. The decoder generates the second attribute matrix based on the second edge set and the node embedding vector.
[0159] Step S350: Generate target graph data based on the node set, the second edge set, and the second attribute matrix.
[0160] In this embodiment, the target graph data includes a second graph structure and a second attribute matrix, wherein the second graph structure includes the node set and the second edge set.
[0161] In summary, this invention employs a graph structure dilution (sampling subgraph data) technique. By increasing the amount of reliable information (unconnected node pairs), it reduces the proportion of unreliable information (connected node pairs), thereby mitigating the impact of unreliable information (imputation attributes and noisy edges) on model performance. Using unconnected node pairs as supervision for graph structure learning avoids the bias introduced by connected node pairs (noisy edges) in the learned graph structure. Assigning different weights to observed and imputation attributes during attribute reconstruction effectively reduces the impact of imputation noise on model performance.
[0162] Furthermore, after obtaining the target graph data, subsequent applications can be executed in this embodiment of the invention. Taking fraud detection as an example, the target graph data is input into a pre-trained GNN-based fraud detection model. The fraud detection model outputs the probability that each node in the target graph data is a fraud node. If the probability is greater than or equal to a predetermined threshold (e.g., 0.8, 0.9, etc.), the corresponding node is identified as a fraud node.
[0163] This invention, through its embodiments, acquires raw graph data including a first graph structure and a first attribute matrix. The first graph structure comprises a node set and a first edge set. A pre-trained structure learner obtains an intermediate edge set based on the first graph structure and the first attribute matrix. A second edge set is then obtained based on the first edge set and the intermediate edge set. A pre-trained graph autoencoder obtains a second attribute matrix based on the second edge set and the first attribute matrix. Target graph data is then generated based on the node set, the second edge set, and the second attribute matrix. Therefore, even in scenarios where graph structure noise and attribute deficiencies coexist, collaborative graph structure learning and node attribute reconstruction simultaneously achieve graph structure optimization and denoising, as well as reliable node attribute generation, resulting in more robust and accurate graph representation learning results.
[0164] Figure 14 This is a schematic diagram of a graph structure data processing device according to an embodiment of the present invention. Figure 14As shown, the graph structure data processing device of this embodiment includes an original graph data acquisition unit 141, an intermediate edge set acquisition unit 142, a second edge set acquisition unit 143, a second attribute matrix acquisition unit 144, and a target graph data acquisition unit 145. The original graph data acquisition unit 141 acquires original graph data, which includes a first graph structure and a first attribute matrix. The first graph structure includes a node set and a first edge set. The intermediate edge set acquisition unit 142 acquires an intermediate edge set based on the first graph structure and the first attribute matrix using a pre-trained structure learner. The second edge set acquisition unit 143 acquires a second edge set based on the first edge set and the intermediate edge set. The second attribute matrix acquisition unit 144 acquires a second attribute matrix based on the second edge set and the first attribute matrix using a pre-trained graph autoencoder. The target graph data acquisition unit 145 generates target graph data based on the node set, the second edge set, and the second attribute matrix. The target graph data includes a second graph structure and the second attribute matrix. The second graph structure includes the node set and the second edge set.
[0165] This invention, through its embodiments, acquires raw graph data including a first graph structure and a first attribute matrix. The first graph structure comprises a node set and a first edge set. A pre-trained structure learner obtains an intermediate edge set based on the first graph structure and the first attribute matrix. A second edge set is then obtained based on the first edge set and the intermediate edge set. A pre-trained graph autoencoder obtains a second attribute matrix based on the second edge set and the first attribute matrix. Target graph data is then generated based on the node set, the second edge set, and the second attribute matrix. Therefore, even in scenarios where graph structure noise and attribute deficiencies coexist, collaborative graph structure learning and node attribute reconstruction simultaneously achieve graph structure optimization and denoising, as well as reliable node attribute generation, resulting in more robust and accurate graph representation learning results.
[0166] Figure 15 This is a schematic diagram of an electronic device according to an embodiment of the present invention. In this embodiment, the electronic device 15 includes a server, a terminal, etc. Figure 15 As shown, the electronic device 15 includes at least one processor 151; a memory 152 communicatively connected to at least one processor 151; and a communication component 153 communicatively connected to a scanning device, wherein the communication component 153 receives and transmits data under the control of the processor 151; wherein the memory 152 stores instructions executable by at least one processor 151, the instructions being executed by at least one processor 151 to implement the above-described graph structure data processing method.
[0167] Specifically, the electronic device includes: one or more processors 151 and a memory 152. Figure 15Taking a processor 151 as an example, the processor 151 and the memory 152 can be connected via a bus or other means. Figure 15 Taking a bus connection as an example, memory 152, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Processor 151 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions, and modules stored in memory 152, thereby implementing the above-mentioned graph structure data processing method.
[0168] Memory 152 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store an option list, etc. Furthermore, memory 152 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 152 may optionally include memory remotely located relative to processor 151, and these remote memories may be connected to external devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0169] One or more modules are stored in memory 152 and, when executed by one or more processors 151, perform the graph structure data processing method in any of the above method embodiments.
[0170] The above-mentioned products can perform the methods provided in the embodiments of this application, and have the corresponding functional modules and beneficial effects of performing the methods. For technical details not described in detail in this embodiment, please refer to the methods provided in the embodiments of this application.
[0171] This invention, through its embodiments, acquires raw graph data including a first graph structure and a first attribute matrix. The first graph structure comprises a node set and a first edge set. A pre-trained structure learner obtains an intermediate edge set based on the first graph structure and the first attribute matrix. A second edge set is then obtained based on the first edge set and the intermediate edge set. A pre-trained graph autoencoder obtains a second attribute matrix based on the second edge set and the first attribute matrix. Target graph data is then generated based on the node set, the second edge set, and the second attribute matrix. Therefore, even in scenarios where graph structure noise and attribute deficiencies coexist, collaborative graph structure learning and node attribute reconstruction simultaneously achieve graph structure optimization and denoising, as well as reliable node attribute generation, resulting in more robust and accurate graph representation learning results.
[0172] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program for use by a computer to execute some or all of the above-described method embodiments.
[0173] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0174] This invention also provides H1, a graph structure data processing method, the method comprising: Obtain raw graph data, which includes a first graph structure and a first attribute matrix, wherein the first graph structure includes a node set and a first edge set; The set of intermediate edges is obtained by a pre-trained structure learner based on the first graph structure and the first attribute matrix; Obtain the second edge set based on the first edge set and the intermediate edge set; The second attribute matrix is obtained by a pre-trained graph autoencoder based on the second edge set and the first attribute matrix; Target graph data is generated based on the node set, the second edge set, and the second attribute matrix. The target graph data includes a second graph structure and the second attribute matrix. The second graph structure includes the node set and the second edge set.
[0175] F2, as described in H1, the step of obtaining the intermediate edge set using a pre-trained structure learner based on the first attribute matrix and the first attribute matrix includes: The attribute vectors of the first node and the second node are obtained based on the first attribute matrix. The first node and the second node are two nodes in a node pair. The attribute vectors of the first node and the second node are the node attributes observed from the first attribute matrix. The intermediate edge set is obtained by a pre-trained structure learner based on the attribute vectors of the first node and the second node.
[0176] H3, as described in H2, the set of intermediate edges is calculated using the following formula:
[0177] in, Let represent the edge weights of nodes u and v, and m be the number of weight vectors in the structure learner. This represents the i-th weight vector. Let be the attribute vector of node u. Let v be the attribute vector of node v.
[0178] H4. As described in H1, obtaining the second edge set based on the first edge set and the intermediate edge set includes: The weights are obtained from the first set of edges and the intermediate set of edges; The second edge set is obtained based on the weights and the comparison result with a predetermined threshold.
[0179] H5, as in the method described in H4, wherein the predetermined threshold includes a first threshold and a second threshold; The step of obtaining the second edge set based on the comparison result of the weights and a predetermined threshold includes: The original connection type of each node pair is determined based on the first edge set; In response to the original connection type of the node pair being a connected node pair, the weight sum is compared with the first threshold. In response to the weight sum being greater than or equal to the first threshold, the weight of the second side is set to 1. In response to the weight sum being less than the first threshold, the weight of the second side is set to 0. In response to the original connection type of the node pair being an unconnected node pair, the weight sum is compared with the second threshold. In response to the weight sum being greater than or equal to the second threshold, the weight of the second side is set to 1. In response to the weight sum being less than the second threshold, the weight of the second side is set to 0.
[0180] H6, as described in H1, the graph autoencoder includes an encoder and a decoder; The step of obtaining the second attribute matrix by the pre-trained graph autoencoder based on the second edge weights and the first attribute matrix includes: Candidate nodes are obtained from the set of nodes, and the candidate nodes are nodes with missing attributes; The missing attributes of each candidate node are imputed using a predetermined interpolation algorithm based on the first attribute matrix to obtain an intermediate attribute matrix. The encoder obtains the learned node embedding vectors based on the second edge set and the intermediate attribute matrix; The decoder generates the second attribute matrix based on the second edge set and the node embedding vector.
[0181] H7, as described in H6, wherein the predetermined interpolation algorithm is the k-nearest neighbor mean algorithm.
[0182] H8. As described in H1, the pre-trained structure learner is obtained through the following steps: Obtain first sample graph data, which includes a first sample graph structure and a first sample attribute matrix. The first sample graph structure includes a first sample node set and a first sample edge set. The first sample graph data is sampled to obtain multiple subgraph data, the subgraph data including subgraph structure and sub-attribute matrix, the subgraph structure including sub-node set and sub-edge set; The predicted edge weights of each node pair in the subgraph data are obtained by the structure learner based on the sub-attribute matrix. Calculate the first loss value corresponding to each subgraph data based on the predicted edge weights and the actual edge weights in the sub-edge set; Calculate the total loss value based on the first loss value corresponding to each subgraph data; The structure learner is optimized based on the total loss value to obtain the pre-trained structure learner.
[0183] H9. As described in H8, sampling the sample graph data to obtain multiple sub-graph data includes: A first number of unconnected node pairs are sampled according to a predetermined dilution ratio, and a second number of connected node pairs are sampled, wherein the dilution ratio is a pre-set ratio of unconnected node pairs to connected node pairs; The subgraph data is generated based on the sampled node pairs.
[0184] H10. As described in H8, the formula for calculating the first loss value is as follows:
[0185] in, Let be the first loss value, n be the total number of node pairs sampled in the subgraph data, and S be the set of node pairs sampled in the subgraph data. Let u and v be the actual edge weights. Let be the predicted edge weights for nodes u and v.
[0186] H11. As described in H8, the formula for calculating the total loss value is as follows:
[0187] in, The total loss value is T, where T is the number of subplot data points. Let be the first loss value corresponding to the i-th subgraph data.
[0188] H12, As described in H6, the pre-trained graph autoencoder is obtained through the following steps: Obtain second sample graph data, which includes a second sample graph structure and a second sample attribute matrix. The second sample graph structure includes a second sample node set and a second sample edge set. The missing attributes of nodes with missing attributes are imputed using a predetermined imputation algorithm based on the second sample attribute matrix to obtain an intermediate attribute matrix. The encoder obtains the learned node embedding vectors based on the second sample graph structure and the intermediate attribute matrix; The decoder generates a prediction attribute matrix based on the second sample graph structure and the node embedding vector. Calculate the second loss value based on the predicted attribute matrix and the intermediate attribute matrix; The encoder and decoder are optimized based on the second loss value to obtain the pre-trained graph autoencoder.
[0189] H13. As described in H12, the formula for calculating the second loss value is as follows:
[0190] in, This is the second loss value. The number of sample nodes. and For pre-set parameters, Greater than , Indicates the index of the observed attribute. Indicates the index of the interpolation attribute. The actual attribute value of the observed attribute. Predicted attribute values for the observed attributes. To interpolate the actual attribute value, The predicted attribute value for the interpolated attribute.
[0191] H14, as described in H12, obtaining the pre-trained graph autoencoder further includes: Obtain labeled sample nodes, wherein the labeled sample nodes are sample nodes with labels; The encoder is used to obtain the node embedding vector of each label sample node; The predicted category of the labeled sample node is obtained by a linear classifier based on the node embedding vector; Calculate a third loss value based on the predicted category and the label category; The encoder is fine-tuned based on the third loss value.
[0192] H15. As described in H14, the formula for calculating the third loss value is as follows:
[0193] in, This is the third loss value. Let be the predicted category of the i-th labeled sample node. Let be the label category of the i-th label sample node. This represents the number of labeled sample nodes.
[0194] H16. A graph-structured data processing system, the system comprising: The graph structure reconstruction module is used to obtain the original graph data, which includes a first graph structure and a first attribute matrix. The first graph structure includes a node set and a first edge set. A pre-trained structure learner obtains an intermediate edge set based on the first graph structure and the first attribute matrix, and obtains a second edge set based on the first edge set and the intermediate edge set. The attribute reconstruction module is used to obtain a second attribute matrix based on the second edge set and the first attribute matrix through a pre-trained graph autoencoder, and to generate target graph data based on the node set, the second edge set and the second attribute matrix. The target graph data includes a second graph structure and the second attribute matrix. The second graph structure includes the node set and the second edge set.
[0195] H17. A graph structure data processing apparatus, the apparatus comprising: The original graph data acquisition unit is used to acquire original graph data, which includes a first graph structure and a first attribute matrix. The first graph structure includes a node set and a first edge set. The intermediate edge set acquisition unit is used to acquire the intermediate edge set based on the first graph structure and the first attribute matrix using a pre-trained structure learner. The second edge set acquisition unit is used to acquire a second edge set based on the first edge set and the intermediate edge set. The second attribute matrix acquisition unit is used to acquire the second attribute matrix based on the second edge set and the first attribute matrix through a pre-trained graph autoencoder. The target graph data acquisition unit is used to generate target graph data based on the node set, the second edge set, and the second attribute matrix. The target graph data includes a second graph structure and the second attribute matrix. The second graph structure includes the node set and the second edge set.
[0196] H18. An electronic device comprising a memory and a processor, the memory being used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of H1-H15.
[0197] H19. A computer program product comprising a computer program that, when run on a computer, performs the method described in any one of H1-H15 above.
[0198] H20. A computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the method as described in any one of H1-H15.
[0199] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A graph structure data processing method, characterized by, The method comprises: obtaining original graph data, the original graph data comprising a first graph structure and a first attribute matrix, the first graph structure comprising a node set and a first edge set; obtaining an intermediate edge set according to the first graph structure and the first attribute matrix by a pre-trained structure learner; obtaining a second edge set according to the first edge set and the intermediate edge set; obtaining a second attribute matrix according to the second edge set and the first attribute matrix by a pre-trained graph autoencoder; generating target graph data according to the node set, the second edge set and the second attribute matrix, the target graph data comprising a second graph structure and the second attribute matrix, the second graph structure comprising the node set and the second edge set.
2. The method of claim 1, wherein, The method comprises: obtaining an attribute vector of a first node and an attribute vector of a second node according to the first attribute matrix, the first node and the second node being two nodes in a node pair, the attribute vector of the first node and the attribute vector of the second node being node attributes observed from the first attribute matrix; obtaining the intermediate edge set according to the attribute vector of the first node and the attribute vector of the second node by the pre-trained structure learner.
3. The method of claim 2, wherein, The intermediate edge set is obtained by the following formula: ; wherein, denotes the edge weight between node u and node v, m is the number of weight vectors of the structure learner, denotes the i-th weight vector, is the attribute vector of node u, is the attribute vector of node v.
4. The method of claim 1, wherein, The method comprises: obtaining a weight sum according to the first edge set and the intermediate edge set; obtaining the second edge set according to a comparison result of the weight sum and a predetermined threshold.
5. The method of claim 4, wherein, The predetermined threshold comprises a first threshold and a second threshold. The method comprises: determining an original connection type of each node pair according to the first edge set; in response to the original connection type of the node pair being a connected node pair, comparing the weight sum with the first threshold, in response to the weight sum being greater than or equal to the first threshold, setting a second edge weight to 1, and in response to the weight sum being less than the first threshold, setting the second edge weight to 0; in response to the original connection type of the node pair being an unconnected node pair, comparing the weight sum with the second threshold, in response to the weight sum being greater than or equal to the second threshold, setting the second edge weight to 1, and in response to the weight sum being less than the second threshold, setting the second edge weight to 0.
6. A graph-structured data processing system, characterized by The system comprises: a graph structure reconstruction module, configured to obtain original graph data, the original graph data comprising a first graph structure and a first attribute matrix, the first graph structure comprising a node set and a first edge set, obtain an intermediate edge set according to the first graph structure and the first attribute matrix by a pre-trained structure learner, and obtain a second edge set according to the first edge set and the intermediate edge set. An attribute reconstruction module is configured to acquire a second attribute matrix from the second edge set and the first attribute matrix by using a pre-trained graph autoencoder, and generate target graph data from the node set, the second edge set and the second attribute matrix, wherein the target graph data comprises a second graph structure and the second attribute matrix, and the second graph structure comprises the node set and the second edge set.
7. A graph structure data processing apparatus, characterized by comprising: The device comprises: An original graph data acquisition unit is configured to acquire original graph data, wherein the original graph data comprises a first graph structure and a first attribute matrix, and the first graph structure comprises a node set and a first edge set; An intermediate edge set acquisition unit is configured to acquire an intermediate edge set from the first graph structure and the first attribute matrix by using a pre-trained structure learner; A second edge set acquisition unit is configured to acquire a second edge set from the first edge set and the intermediate edge set; A second attribute matrix acquisition unit is configured to acquire a second attribute matrix from the second edge set and the first attribute matrix by using a pre-trained graph autoencoder; A target graph data acquisition unit is configured to generate target graph data from the node set, the second edge set and the second attribute matrix, wherein the target graph data comprises a second graph structure and the second attribute matrix, and the second graph structure comprises the node set and the second edge set.
8. An electronic device comprising a memory and a processor, characterized in that The memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any one of claims 1-5.
9. A computer program product comprising a computer program, characterized in that, When the computer program runs on the computer, the computer executes the method of any one of claims 1-5.
10. A computer readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions, when executed by the processor, implement the method of any one of claims 1-5.