Graph processing method and system based on automatic graph coding
By introducing the automatic coding and direction of the mask mask strategy in the graph processing method, the problem of poor generalization capacity and weak robustness caused by the dependent label in the existing technology, and realized the less label or label without labels. High -quality charts represent the improvement of learning and classification tasks.
Patent Information
- Application Number
- CN202411378026.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
Existing graph processing methods rely heavily on labels, resulting in poor generalization capabilities, especially when training data is scarce, and the model is vulnerable to adversarial attacks and has weak robustness.
Put forward a diagram processing method based on the graph automatically encoded, through the pre -processing of the node and the edge of the graph, including mask and noise injection, combined with the direction of perceived the mask strategy, enter the diagram data to the diagram neural network model, complete the classification task to complete the classification task, and complete the classification task to complete the classification task. Essence
Through the mask mechanism and noise injection, it can generate high -quality diagrams without relying on a large number of label data, improving the learning ability and robustness of the neural network, and enhancing the task matching ability of the graph structure data.
Smart Images

Figure CN119357448A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a graph processing method and system based on graph automatic encoding. Background Art
[0002] In recent years, deep learning on graph-structured data has become increasingly popular in the field of artificial intelligence research, as graph-structured data are ubiquitous in a wide range of fields, including e-commerce, transportation, chemistry, and knowledge bases. Most deep learning research on graphs focuses on (semi-)supervised learning scenarios, where specific downstream tasks (e.g., node classification) are exploited to train models with detailed manual annotations. Despite the success of these studies, the heavy reliance on labels comes with several drawbacks. First, the cost of collecting and annotating manual labels is prohibitive, especially for research fields with large-scale datasets (e.g., citations and social networks) or that require domain knowledge (e.g., chemistry and medicine). Second, purely supervised learning scenarios often suffer from poor generalization capabilities due to the overfitting problem, especially when training data is scarce. Third, supervised graph deep learning models are vulnerable to label-related adversarial attacks, resulting in weak robustness of graph supervised learning.
[0003] At present, there is an urgent need for a classification method for scenarios with little training data or labels. Summary of the invention
[0004] In view of this, in order to solve the technical problem that most of the existing graph processing methods rely heavily on labels, resulting in poor generalization ability, the present invention proposes a graph processing method based on graph automatic encoding, the method comprising the following steps:
[0005] Get graph data;
[0006] Performing graph node preprocessing on the graph data. The main function of this step is to perform masking and noise injection on the input graph structure and feature matrix.
[0007] Performing graph edge preprocessing on the graph data, and considering the directionality between nodes and edges when masking the graph structure, so as to retain the structural information of the graph;
[0008] Input the preprocessed graph data into the graph neural network model to complete the classification task;
[0009] The graph neural network model includes an encoder and a decoder.
[0010] Among them, the main task of the encoder is to convert the input graph structure and node features into a lower-dimensional representation (embedding) for further processing by subsequent decoders or other model components; the working process of the decoder is mainly to process the feature representation from the encoder to reconstruct the input features or generate other related outputs.
[0011] In some embodiments, the step of performing graph node preprocessing on the graph data further includes:
[0012] Randomly arrange node indexes and divide masked nodes and unmasked nodes using the randomly arranged node indexes and preset rules;
[0013] Further, from the nodes of the mask, it is selected which mask nodes are used for noise injection and which are used for direct replacement with mask markers.
[0014] In some embodiments, the step of performing graph edge preprocessing on the graph data further includes:
[0015] Compute the in-degree and out-degree of nodes, the masked probabilities of graph nodes, and the masked probabilities of graph edges.
[0016] Traditional graph masking strategies often ignore the directionality of nodes and edges in the graph and simply randomly mask nodes or edges, which may cause the model to fail to fully capture the global and local structures of the graph. Therefore, in the edge message preprocessing stage of the graph, we introduced the Direction-Aware Graph Masking Strategy (DAGMS). The core idea of this method is to consider the directionality between nodes and edges when masking the graph structure, thereby preserving the structural information of the graph.
[0017] In some embodiments, the preprocessed graph data is input into the step of the graph neural network model:
[0018] The working process of the encoder can be understood as a stack of a series of graph convolutional layers or other graph neural network layers. Each layer transforms and aggregates the features of the nodes and finally outputs the embedded representation of the nodes.
[0019] The middle part between the encoder and decoder of the model usually involves extracting features from the encoder output and preparing them for the decoder input.
[0020] The working process of the decoder is as follows: first, the output of the encoder is received; before the feature representation is passed to the decoder, this representation is projected through a linear layer so that its dimension matches the input requirements of the decoder; the decoder receives rep (the projection of the encoder output) as input and generates the reconstructed features of the node or other related outputs.
[0021] The present invention also proposes a graph processing system based on graph automatic encoding, the system comprising:
[0022] A data acquisition module, used to acquire graph data;
[0023] A preprocessing module performs graph node preprocessing on the graph data based on mask and noise; performs graph edge preprocessing on the graph data based on the directionality between graph nodes and graph edges;
[0024] The graph structure application module inputs the preprocessed graph data into the graph neural network model to complete the classification task; the graph neural network model includes an encoder and a decoder.
[0025] Based on the above scheme, the present invention provides a graph processing method and system based on graph auto-encoding, which utilizes the framework structure of graph auto-encoder (GAE) and efficiently captures the global information hidden in the graph structure through the mask mechanism. After introducing the mask and noise, the entire input structure is not reconstructed, but a part of the edges are randomly masked, and then the masked points and the missing edges are learned to be reconstructed through an effective masking strategy and an expressive decoder network. By introducing the idea of masked autoencoder into graph neural network, an effective self-supervised learning framework is proposed, which can generate high-quality graph representation without relying on a large amount of labeled data, so as to better match various graph structure data tasks and improve the accuracy of related tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flowchart of the steps of a graph processing method based on graph automatic encoding of the present invention;
[0027] Figure 2 It is a structural block diagram of a graph processing method system based on graph automatic encoding of the present invention. DETAILED DESCRIPTION
[0028] To address the shortcomings of (semi-)supervised learning, self-supervised learning (SSL) provides a promising learning paradigm that can reduce the reliance on human annotations.
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] It should be noted that, for the convenience of description, only the parts related to the relevant invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other.
[0031] It should be understood that the "system", "device", "unit" and / or "module" used in this application is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the word can be replaced by other expressions.
[0032] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "a kind" and / or "the" do not refer to the singular, but also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of clearly identified steps and elements, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements. The elements defined by the sentence "includes a..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.
[0033] In the description of the embodiments of the present application, "plurality" means two or more than two. The following terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0034] In addition, flow charts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, the various steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or a certain step or several steps of operations may be removed from these processes.
[0035] Reference Figure 1 , is a flow chart of an optional example of a graph processing method based on graph automatic encoding proposed in the present invention, which can be applied to a computer device. The graph processing method proposed in this embodiment may include but is not limited to the following steps:
[0036] Step S1, obtaining graph data;
[0037] Step S2: performing graph node preprocessing on the graph data based on the mask and the noise;
[0038] Step S3, performing graph edge preprocessing on the graph data based on the directionality between graph nodes and graph edges;
[0039] Step S4: input the preprocessed graph data into the graph neural network model to complete the classification task;
[0040] The graph neural network model includes an encoder and a decoder.
[0041] Step S5: Using accuracy as an evaluation indicator, perform performance evaluation on the graph neural network model.
[0042] In some feasible embodiments, the step S2 specifically includes:
[0043] S2.1, initializing the graph data;
[0044] S2.2, randomly arrange the node indexes to obtain a random sequence;
[0045] Initialize the graph data and randomly arrange the node indexes. After obtaining the number of nodes in the graph, "num_nodes", use the random permutation function "randperm" to generate a random permutation from 0 to num_nodes-1, indicating the random index of the node:
[0046] per_mask=(σ(0),σ(1),σ(2),…,σ(n-1))
[0047] S2.3, calculate the number of mask nodes;
[0048] After generating a random sequence, by the formula: mask = int(mask _ rate×N) to calculate the required number of mask nodes; mask_rate represents the mask ratio.
[0049] S2.4. Selecting masked nodes and non-masked nodes from the index of the random sequence;
[0050] After calculating the required mask nodes and retention, select the first num_mask_nodes nodes from the randomly arranged index as the nodes that need to be masked; select the remaining nodes as the nodes that are not to be masked.
[0051] S2.5, calculate the number of nodes where noise is injected;
[0052] The next step is to inject the mask and noise; the number of nodes that need to be injected with noise is calculated based on the "replace_rate".
[0053] S2.6. Based on the random sequence, select a noise injection node and a mask marking node from the mask nodes.
[0054] The indexes of the mask nodes are randomly permuted by the “randperm” function above to select which mask nodes are used for noise injection and which are used for direct replacement with mask markers;
[0055] perm _ mask=(σ mask(0),σ mask (1),…,σ mask (n mask ―1))
[0056] Select "mask_token_rate" proportion of nodes from "mask_nodes" that will be replaced with the mask token (usually a zero vector): mask _ nodes=perm[:n mask ]Then select "replace_rate" proportion of nodes from "mask_nodes", these nodes will be replaced with noise features; finally, randomly select "num_noise_nodes" nodes from all nodes, and their features will be injected into "noise_nodes" as noise.
[0057] token _ nodes=mask _ nodes[perm _ mask[:n token ]]
[0058] noise ― nodes=mask _ nodes[perm _ mask[―n noise :]]
[0059] After selecting the required feature mask and noise mask nodes, create a copy of the feature matrix x out_x so that the original input is not modified, replace the features of the mask nodes with zero vectors (or other mask tags), and replace the features of the noise nodes with node features randomly selected from other nodes. After that, we add a learned parameter vector (mask tag) to the feature vector of the mask node so that the features of the mask node have a special mask representation, and then clone the graph g to prevent modification of the original graph. Finally, this part will return the cloned graph structure use_g, return the feature matrix out_x after masking and noise injection, and the indexes of the mask nodes and retained nodes (mask_nodes, keep_nodes) for use in subsequent steps.
[0060] In some feasible embodiments, the step S3 specifically includes:
[0061] S3.1. Based on the graph data, calculate the in-degree and out-degree of the node;
[0062] The nodes and edges in graph data usually have complex topological structures, and the information transmission between nodes is directional. For example, in social networks, the influence between users may be unidirectional, and this directionality plays an important role in learning graph structures. However, traditional graph masking strategies often ignore the directionality of nodes and edges in the graph, and simply randomly mask nodes or edges, which may cause the model to fail to fully capture the global and local structures of the graph. Therefore, in the edge message preprocessing stage of the graph, we introduced the Direction-Aware Graph Masking Strategy (DAGMS). The core idea of this method is to consider the directionality between nodes and edges when masking the graph structure, thereby retaining the structural information of the graph. For a given directed graph G = (V, E), where V represents the node set and E represents the edge set, we first need to calculate the in-degree and out-degree of each node. These two represent the number of edges pointing to the node and the number of edges starting from the node, respectively. For each node v, we use the formula:
[0063]
[0064] Calculate the in-degree of each point, where (v j ,v i )∈E is the indicator function, when (v j ,v i ) is an edge in the graph, its value is 1, otherwise it is 0.
[0065] Then calculate the out-degree of each node:
[0066]
[0067] Here we also use the indicator function to determine whether there is a i to v j edge.
[0068] S3.2, assigning a mask probability to the graph node according to the in-degree and the out-degree;
[0069] According to the in-degree and out-degree information of the node, DAGMS assigns a mask probability p to each node. v (v i ). This probability determines whether to mask the node during training. The calculation formula for mask probability is as follows:
[0070]
[0071] Where α and β are hyperparameters used to adjust the importance of in-degree and out-degree, d in (v i ) and d out (v i ) are nodes vi This formula means that nodes with larger in-degree and out-degree (i.e., those nodes that are more critical in the graph structure) have a greater probability of being masked, thereby guiding the model to focus on the global structure of the graph.
[0072] S3.3, combining the directionality of the edge and the mask probability of the corresponding connected nodes, calculate the mask probability of the graph edge;
[0073] For each edge p in the graph e (e ij )=(v j ,v i ), DAGMS calculates the mask probability p by combining the directionality of the edge and the mask probability of the connected node. e (e ij ). The specific formula is as follows:
[0074] p e (e ij )=γ·p v (v i )+δ·p v (v j )
[0075] p v (v i ) and p v (v j ) is the mask probability of the nodes at both ends of the edge. γ and δ are weight parameters that control the influence of direction perception on edge masking.
[0076] In this way, edges connecting key nodes are more likely to be masked, thus encouraging the model to learn deeper structural information of the graph during training.
[0077] S3.4. Perform a mask operation on the graph data according to the mask probability of the nodes and the mask probability of the graph edges.
[0078] According to the calculated node mask probability p v (v i ) and edge mask probability p e (e ij ), DAGMS performs masking operations on the graph structure. Specifically: a number between 0 and 1 is randomly generated, and for each node v i , if the number is less than p v (v i ), then mask the node. Similarly, for each edge e ij , if the random number is less than p e (e ij), then mask the edge. The masking operation can be achieved by replacing the masked nodes or edges with invalid values (such as zero vectors or special markers). After the masking operation is completed, the masked graph structure is input into the graph neural network, and the model is trained using a self-supervised learning framework. The goal of the model is to reconstruct the masked part by learning the global and local structures of the graph. Commonly used loss functions include reconstruction error (such as cross entropy or mean squared error), and the model parameters are updated by minimizing the loss.
[0079] The direction-aware graph masking strategy designs a more reasonable masking strategy by considering the directionality of nodes and edges. The specific steps include calculating the in-degree and out-degree of the node, determining the masking probability based on this information, masking the graph structure, and training the model in a self-supervised learning framework. With this strategy, the model can better understand the complex topological structure of the graph, thereby achieving superior performance in various graph tasks.
[0080] In some feasible embodiments, the step S4 specifically includes:
[0081] S4.1, the encoder transforms the graph structure and node features to generate node embedding;
[0082] In this part, the main work of the encoder is to convert the input graph structure and node features into a higher-dimensional representation (embedding) for further processing by subsequent decoders or other model components. The working process of the encoder can be understood as a stack of a series of graph convolutional layers or other graph neural network layers. Each layer transforms and aggregates the features of the nodes and finally outputs the embedded representation of the nodes. The first step is to process the input. First, the encoder accepts two main input graph structures and node feature matrices. The graph structure contains information about nodes and edges, usually represented by an adjacency matrix or edge list; the node feature matrix is a matrix of shape N×d, where N is the number of nodes and d is the dimension of the feature.
[0083] Next is the operation of the graph convolution layer. In each layer of graph convolution, the features of the nodes will be updated. The core of this process is neighborhood aggregation, which can be described by the following formula:
[0084]
[0085] in represents the feature representation of node i in the l+1th layer, represents the set of neighbor nodes of node i, c ij Represents the normalization coefficient, which is usually related to the degree of the graph and represents the weight of information propagation, W (l)represents the weight matrix of the lth layer, and σ represents a nonlinear activation function (such as ReLU). This formula describes how to aggregate the features of node i with the features of its neighbor node j to generate a new node representation.
[0086] If an attention-based model (such as GAT) is used in the encoder network, a multi-head attention mechanism will be introduced:
[0087]
[0088] represents the attention coefficient, which indicates the importance of node j to node i in the kth head, K represents the number of attention heads, and || represents concatenating the representations from different heads. It is calculated by the softmax function, the specific formula is:
[0089]
[0090] Here, || represents the concatenation of vectors.
[0091] The output of each layer will go through a nonlinear activation function (such as ReLU) and a normalization operation (such as BatchNormalization or Layer Normalization): In deep networks, to prevent information loss, the encoder may use residual connections: This means that the output of the l+1th layer is the sum of the output calculated by this layer and the input of the previous layer.
[0092] The final output of the encoder is the embedding representation of the node, with a shape of N×h, where h is the dimension of the hidden layer. The main function of the encoder is to transform the node features through multiple layers of graph convolution (or other graph neural network layers), and combine the structural information of the graph to generate node embeddings suitable for subsequent tasks. It takes advantage of the neighbor relationship of the graph, updates the representation of the node by aggregating the information of neighbor nodes, and may use multi-head attention mechanism, residual connection and other technologies to enhance the representation ability of the model.
[0093] S4.2, embedding the node and projecting it to obtain a feature representation after projection;
[0094] The middle part between the encoder and decoder of the model usually involves extracting features from the encoder output and preparing them for the decoder input. The specific implementation of this part depends on the design and goals of the model. At the encoder output, the encoder processes the input data and generates a feature representation (usually a hidden layer representation) that contains key information about the input data. The encoder output may be further processed to better suit the decoder input requirements. This includes feature concatenation and linear transformation. Feature concatenation concatenates the outputs of all hidden layers together to increase the dimension of the features; linear transformation uses a linear layer to project the encoder output to match the decoder input dimension. The above processed feature representations will be input to the decoder to reconstruct the original input or predict new information. The decoder will try to reconstruct the properties of the original input or generate the desired output through these processed features.
[0095] S4.3. Operation of the decoder.
[0096] The working process of the decoder is mainly to process the feature representation from the encoder to reconstruct the input features or generate other related outputs. The first is to receive the output of the encoder. The encoder processes the node features of the input graph and generates a hidden layer representation (or feature representation). Before passing the feature representation to the decoder, this representation will be projected through a linear layer to match its dimension with the input requirements of the decoder: rep = W d ·enc _ rep where W d is the weight matrix of the linear transformation, and rep is the feature representation after projection. If the decoder type is not "mlp" or "linear", specific nodes are re-masked before entering the decoder to prevent information leakage. This step is to zero some features in the encoder output rep[mask _ nodes]=0, ensuring that the decoder must reconstruct the masked node features based on information from other nodes.
[0097] Next comes the decoding process. The decoder receives rep (the projection of the encoder output) as input and generates the reconstructed features of the node or other related outputs. The decoder can be in the form of a multi-layer perceptron (MLP) or other graph network structures, such as the graph attention network (GAT). The output formula of the decoder can be expressed as: recon = f decoder (rep,pre_use_g), where f decoder{} is the function of the decoder network, and pre_use_g is the graph structure that may be passed (in some cases the decoder requires topological information of the graph). After decoding is completed, the model needs to perform some subsequent operations to complete the entire forward propagation process and prepare for model updates. The first is the loss calculation. The reconstructed features output by the decoder are compared with the target features to calculate the loss. The loss function measures the difference between the model output and the actual target, which is the core driving force of model training. In the loss function calculation process, two tensors x and y are first input, representing a pair of feature vectors to be compared; then a scalar alpha is input to adjust the shape of the loss. Use the F.normalize function to normalize x and y to unit length vectors (L2 regularization). After normalization, the norm of each vector is 1, so that you can focus on the directional differences between vectors rather than their magnitude.
[0098]
[0099] The cosine similarity of two normalized vectors is calculated by the dot product. This is equivalent to measuring the angle between the vectors:
[0100]
[0101] Then, calculate 1-cos_sim to get the cosine distance; then adjust the loss to increase the distance value to the alpha power: loss = (1-cos_sim) α By adjusting alpha, the sensitivity of the loss to similarity can be controlled, and finally the loss of all samples is averaged. This loss function promotes the model to learn effective feature representations by comparing the similarity of feature vectors, and provides greater flexibility to control the shape of the loss. This loss function can help the model learn meaningful feature representations in self-supervised learning, contrastive learning and other similar tasks.
[0102] In some feasible embodiments, the step S5 specifically includes:
[0103] This evaluation process is aimed at evaluating the performance of the graph neural network (GNN) model in the node classification task. This process mainly includes model training, verification and testing. The performance of the model is evaluated by its performance on the verification set, and finally the evaluation results are given on the test set.
[0104] First, the model is preprocessed. The model is initialized and switched to evaluation mode, which means that the model parameters are no longer updated during the forward propagation process. Next, using the linear probing strategy, we first generate an embedding representation of the node through the model. Embedding is a high-dimensional representation of the node's features after passing through the encoder. Assuming the input feature matrix is X, the embedding representation is: H = fencoder (G,X), where G is the input graph structure, f encoder It is the encoder part of the model; if linear detection is used, a logistic regression classifier is initialized, which receives the embedding vector as input and outputs the classification result. During the training process, the cross entropy loss function is usually used to measure the difference between the predicted value and the true label. The model training process is completed by the following steps: forward propagation: input the graph and node features into the model and calculate the output (logits); loss calculation: use the cross entropy loss function to calculate the loss of the training set; back propagation: calculate the gradient and update the model parameters; performance evaluation: after each epoch, evaluate the model performance on the validation set and calculate the accuracy of the validation set. In order to avoid overfitting, an early stopping mechanism is used. When the accuracy on the validation set no longer improves, stop training and save the best performing model. Finally, the performance of the model is evaluated on the test set. After training is completed, the accuracy of the test set is output, as well as the accuracy of the test set when early stopping is used. In this evaluation process, the model first generates node embeddings or predicted outputs through forward propagation, and then adjusts the model parameters through the training process to minimize the loss. Finally, the performance of the model is measured by the accuracy on the validation set and the test set, and the early stopping mechanism is used to prevent overfitting.
[0105] Based on the above scheme, the present invention proposes an innovative method to improve the representation learning ability of graph neural networks in unlabeled or low-label situations by combining masking mechanism, noise injection and self-supervised learning framework. Its design takes into account the characteristics of graph data, can be flexibly applied in different data distributions and task scenarios, and has good robustness and generalization capabilities. These innovations enable this method to be applied to classification tasks and has strong competitiveness. The application process is specifically to convert the data to be classified into graph data / graph structure, and apply the method of the present invention for processing.
[0106] like Figure 2 As shown, a graph processing system based on graph automatic encoding includes:
[0107] A data acquisition module, used to acquire graph data;
[0108] A preprocessing module performs graph node preprocessing on the graph data based on mask and noise; performs graph edge preprocessing on the graph data based on the directionality between graph nodes and graph edges;
[0109] The graph structure application module inputs the preprocessed graph data into the graph neural network model to complete the classification task; the graph neural network model includes an encoder and a decoder.
[0110] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0111] A graph processing device based on graph automatic encoding:
[0112] at least one processor;
[0113] at least one memory for storing at least one program;
[0114] When the at least one program is executed by the at least one processor, the at least one processor implements the graph processing method based on graph automatic encoding as described above.
[0115] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0116] A storage medium stores processor-executable instructions, which are used to implement a graph processing method based on graph automatic encoding as described above when executed by a processor.
[0117] The contents of the above method embodiments are all applicable to the present storage medium embodiments. The functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0118] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A graph processing method based on graph automatic encoding, characterized in that: The following steps are involved: Get graph data; Based on the mask and the noise, performing graph node preprocessing on the graph data; Based on the directionality between graph nodes and graph edges, performing graph edge preprocessing on the graph data; Input the preprocessed graph data into the graph neural network model to complete the classification task; The graph neural network model includes an encoder and a decoder.
2. According to claim 1, a graph processing method based on graph automatic encoding is characterized in that: Also includes: The performance of the graph neural network model is evaluated using accuracy as an evaluation indicator.
3. The graph processing method based on graph automatic encoding according to claim 1, characterized in that: The step of performing graph node preprocessing on the graph data based on mask and noise specifically includes: Initializing the graph data; Randomly arrange the node indexes to get a random sequence; Based on the random sequence, the graph nodes are injected with noise and marked with masks.
4. The graph processing method based on graph automatic encoding according to claim 3, characterized in that: The step of injecting noise and masking the graph nodes based on the random sequence specifically includes: Calculate the number of mask nodes; Selecting masked nodes and non-masked nodes from the indexes of the random sequence; Calculate the number of nodes where noise is injected; A noise injection node and a mask marking node are selected from the mask nodes based on the random sequence.
5. The graph processing method based on graph automatic encoding according to claim 1, characterized in that: The step of performing graph edge preprocessing on the graph data based on the directionality between graph nodes and graph edges specifically includes: Based on the graph data, calculate the in-degree and out-degree of the node; assigning a mask probability to the graph node according to the in-degree and the out-degree; Combining the directionality of the edge and the mask probability of the corresponding connected nodes, the mask probability of the graph edge is calculated; A masking operation is performed on the graph data according to the masking probabilities of the nodes and the masking probabilities of the graph edges.
6. The graph processing method based on graph automatic encoding according to claim 4, characterized in that: The calculation formula of the node's mask probability is as follows: Among them, α and β represent different hyperparameters, d in (v i ) represents node v i The in-degree, d out (v i ) represents node v i The out-degree of V represents the node set, d in (v j ) represents node v j The in-degree, d out (v j ) represents node v j The out-degree of .
7. The graph processing method based on graph automatic encoding according to claim 5, characterized in that: The step of inputting the preprocessed graph data into the graph neural network model to complete the classification task specifically includes: Input the preprocessed graph data into the graph neural network model; The encoder transforms the graph structure and node features in the preprocessed graph data through multi-layer graph convolution to generate node embedding; Embedding the node and projecting it to obtain a projected feature representation; The decoder generates a reconstructed feature of the node according to the projected feature representation; The classification task is completed according to the reconstructed features of the nodes.
8. A graph processing system based on graph automatic encoding, characterized in that: include: A data acquisition module, used to acquire graph data; A preprocessing module performs graph node preprocessing on the graph data based on mask and noise; performs graph edge preprocessing on the graph data based on the directionality between graph nodes and graph edges; The graph structure application module inputs the preprocessed graph data into the graph neural network model to complete the classification task; the graph neural network model includes an encoder and a decoder.
9. A graph processing device based on graph automatic encoding, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the graph processing method based on graph automatic encoding as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Model training method and system for automatic coding of graph with random noise mask
CN116894456A
Cited By
Characterization fine tuning method and system in training during graph data node classification test
CN121599043A
A sparse concept prerequisite relationship prediction method and device based on hypergraph learning
CN122734573A