Directed semantic prompt-based mask graph auto-encoder learning method and system
By introducing a directed semantic cueing mechanism into the mask graph autoencoder and constructing an asymmetric cueing structure, the semantic bias and noise interference problems of the mask graph autoencoder in unsupervised feature reconstruction tasks are solved, thereby improving the robustness of graph representation learning and the accuracy of downstream tasks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-18
- Publication Date
- 2026-04-14
AI Technical Summary
Existing masked image autoencoders suffer from semantic bias caused by masking operations and a lack of directional semantic guidance in the reconstruction process during unsupervised feature reconstruction tasks. This results in distorted node representations learned by the model, failing to accurately reflect the true attributes of the nodes.
A directed semantic prompting mechanism is introduced. By constructing an online network and a target network, the latent semantics generated by the target network are used as guidance to construct an asymmetric prompting structure to assist in the reconstruction of mask nodes. The encoder parameters are optimized by combining the feature reconstruction task with the latent representation comparison task.
It significantly improves the adaptability of graph neural networks in downstream tasks, solves the semantic bias caused by masking and noise interference in the reconstruction process, and improves the robustness of graph representation learning and the accuracy of downstream tasks.
Smart Images

Figure CN121859974A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a learning method and system for a mask graph autoencoder based on directed semantic prompts. Background Technology
[0002] Graph Neural Networks (GNNs), as a core technology for processing graph-structured data, have been widely applied in fields such as social network analysis, recommender systems, and bioinformatics. However, training GNN models typically relies on large amounts of high-quality labeled data, while obtaining labels in real-world scenarios is often costly and time-consuming. To reduce the dependence on labels, Graph Self-Supervised Learning (GSSL) techniques have emerged. Among them, Masked Graph Autoencoder (MGAE) is a mainstream generative self-supervised learning method. Its core idea is to force the model to reconstruct the missing parts using the remaining information from the masked graph (such as node features or edges), thereby learning robust node representations.
[0003] Currently, one of the closest existing technologies to this application is GraphMAE (Graph Masked Autoencoder) and its derivative methods proposed in "GraphMAE: Self-Supervised Masked Graph Autoencoders". These methods typically include the following technical steps:
[0004] Feature masking: First, the input graph data is processed, a masking rate is set, some nodes are randomly selected as mask objects, and their feature vectors are replaced with all-zero vectors or specific learnable vectors.
[0005] Encoding aggregation: The masked graph is input into the graph encoder. Based on the graph's topology, the encoder aggregates the feature information of unmasked neighboring nodes to generate latent representations of all nodes.
[0006] Feature reconstruction: The decoder receives the latent representation output by the encoder, and after masking the latent representation of the masked node, it predicts and reconstructs the original features of the masked node through a structure such as a multilayer perceptron or graph attention network.
[0007] Model optimization: Calculate the difference between the reconstructed features and the original features (usually using the scaled cosine error as the loss function), and update the encoder parameters by minimizing this reconstruction error.
[0008] In related technical fields (such as natural language processing or few-shot graph learning), there exists a technique called "cued learning." Its essence is to guide the model's output or adapt it to a specific task by adding additional auxiliary information (such as tokens or specific edge structures) to the input data.
[0009] Although this application does not belong to the field of "graph hint learning" for solving downstream task adaptation problems, existing technologies lack a solution to effectively apply this idea of "introducing auxiliary structures for semantic guidance" to unsupervised feature reconstruction tasks. Current masked graph autoencoders mainly rely on the original incomplete structure of the graph for passive inference, without introducing an active semantic hint mechanism to assist the reconstruction process.
[0010] Although existing masked image autoencoders have achieved some success in graph representation learning, they still suffer from two core shortcomings that are difficult to overcome when dealing with unsupervised feature reconstruction tasks:
[0011] 1. Masking operations lead to severe semantic bias. Existing techniques forcibly clear the feature information of nodes during the masking process, causing the encoder to rely entirely on physical neighbor nodes during aggregation. However, graph data often exhibits heterogeneity, meaning that the neighbors of a masked node may belong to completely different categories. In this case, the aggregated representation will inevitably shift towards the semantic category of its neighbors. The masked node not only loses its own information but is also "assimilated" by the erroneous semantics of its neighbors, resulting in distorted node representations learned by the model that fail to accurately reflect the true attributes of the nodes.
[0012] 2. Lack of "Directed Semantic Guidance" in the Reconstruction Process: Existing generative methods primarily rely on the original incomplete topology of the graph for "passive inference," lacking an active semantic repair mechanism. On the one hand, existing technologies do not introduce global semantic filtering, failing to utilize distant but semantically similar nodes to assist in reconstruction; on the other hand, the few methods that attempt to enhance the structure typically employ symmetric (undirected) connections or calculate similarity based on original features. This symmetry ignores the specificity of the masking task, causing noise (or all-zero features) from masked nodes to propagate back to high-quality similar nodes, resulting in "semantic diffusion" and ultimately damaging the overall quality of the graph representation. Summary of the Invention
[0013] To address the shortcomings of existing technologies, this application provides a learning method and system for a mask graph autoencoder based on directed semantic prompts.
[0014] Firstly, a mask graph autoencoder learning method based on directed semantic prompts is provided, including:
[0015] On the computing processing unit, online networks and target networks are constructed;
[0016] The original graph is input into the encoder of the target network. The encoder of the target network aggregates the neighborhood information of the nodes and outputs the node representation of the original graph.
[0017] A directed semantic cue graph is constructed using the node representations of the original graph as mask nodes;
[0018] The directed semantic cue graph is input into the encoder of the online network to obtain the online node representation. The masked node part in the online node representation is masked again and then sent to the decoder of the online network to predict the original features of the masked nodes, thus obtaining the predicted features of the masked nodes.
[0019] The online node representations are input into the projector of the online network to obtain the online latent representation, and the node representations of the original graph are input into the projector of the target network to obtain the target latent representation. The latent representation contrast loss is calculated based on the online latent representation and the target latent representation. The feature reconstruction loss is calculated based on the difference between the predicted features of the masked nodes and the original features of the masked nodes. The total loss is calculated based on the latent representation contrast loss and the feature reconstruction loss, and gradient descent is performed based on the total loss to enable the encoder to learn the optimized encoder.
[0020] Furthermore, the parameters of the online network are updated using gradient descent, and the parameters of the target network are updated using the exponential moving average of the online network parameters.
[0021] Furthermore, the construction of a directed semantic hint graph using the node representations of the original graph as mask nodes specifically includes:
[0022] Randomly sample nodes from the original graph and mask them to obtain a set of masked nodes;
[0023] The feature vectors of the mask nodes in the mask node set are replaced with learnable mask vectors to obtain the feature matrix of the mask nodes.
[0024] Using the node representation of the original graph, calculate the cosine similarity between each mask node and other nodes in the original graph to obtain the similarity matrix;
[0025] Based on the similarity matrix, a directed semantic cue graph is constructed.
[0026] Furthermore, the cosine similarity between each mask node and other nodes in the original graph is calculated using the following formula:
[0027] ;
[0028] in, Let i be the i-th mask node in the set of mask nodes; The j-th node in the set of all nodes; For the set of mask nodes; for Cosine similarity; For the set of all nodes; Let i be the node representation of the i-th mask node; Let j be the node representation of the j-th node; Let be the magnitude of the vector representing the node of the i-th mask node; Let be the magnitude of the vector representing the node of the j-th node.
[0029] Furthermore, the construction of the directed semantic cue graph based on the similarity matrix includes:
[0030] For any mask node Sort all similarity values in the similarity matrix from highest to lowest; select the top K similarity nodes as prompt nodes; the top K similarity nodes do not include mask nodes. itself;
[0031] Add a pointer from the prompt node to any of the mask nodes in the mask image. By considering the directed edges, we obtain a directed semantic hint graph.
[0032] Further, the process of re-masking the masked node portion in the online node representation and then feeding it into the decoder of the online network to predict the original features of the masked nodes, thereby obtaining the predicted features of the masked nodes, includes:
[0033] Set the online node representation at the corresponding mask node position to zero;
[0034] The zeroed-out online node representations are input into the online network decoder to reconstruct the predicted features of the mask nodes.
[0035] Furthermore, the parameters of the target network are updated using the exponential moving average of the online network parameters, calculated as follows:
[0036] ;
[0037] in, The momentum coefficient, ; For target network parameters ; These are online network parameters.
[0038] Furthermore, the latent representation contrast loss is calculated based on the online latent representation and the target latent representation; the calculation formula is as follows:
[0039] ;
[0040] in, This represents the potential contrast loss; This is the scaling factor; The number of mask nodes; Let i be the i-th mask node in the set of mask nodes; For the set of mask nodes; Let be the potential representation of the i-th mask node after projection into the online network; Let be the latent representation of the i-th mask node after projection into the target network; T is the vector transpose. Let be the modulus of the latent representation of the i-th mask node after projection into the online network; Let be the modulus of the potential representation of the i-th mask node after projection into the target network.
[0041] Furthermore, the difference between the predicted features of the mask node and the original features of the mask node is used to calculate the feature reconstruction loss, as shown in the following formula:
[0042] ;
[0043] in, For feature reconstruction loss; The number of mask nodes; This is the scaling factor; Let i be the i-th mask node in the set of mask nodes; For the set of mask nodes; It is the vector transpose of the original features of the i-th mask node; The predicted features of the i-th mask node; Let be the magnitude of the vector of the original features of the i-th mask node; Let be the magnitude of the vector of predicted features of the i-th mask node.
[0044] Secondly, a mask graph autoencoder learning system based on directed semantic prompts is provided, including:
[0045] A dual-stream network architecture module is used to build an online network and a target network on the computing processing unit;
[0046] The potential benchmark generation module is used to input the original graph into the encoder of the target network. The encoder of the target network aggregates the neighborhood information of the nodes and outputs the node representation of the original graph.
[0047] The semantic hint graph construction module is used to construct a directed semantic hint graph by using the node representations of the original graph as mask nodes;
[0048] The feature reconstruction module is used to input the directed semantic cue graph into the encoder of the online network to obtain the online node representation, and then mask the masked node part in the online node representation again before sending it into the decoder of the online network to predict the original features of the masked nodes, thereby obtaining the predicted features of the masked nodes.
[0049] The loss calculation module is used to input the online node representations into the projector of the online network to obtain the online latent representation, and input the node representations of the original graph into the projector of the target network to obtain the target latent representation; calculate the latent representation comparison loss based on the online latent representation and the target latent representation; calculate the feature reconstruction loss based on the difference between the predicted features of the masked nodes and the original features of the masked nodes; calculate the total loss based on the latent representation comparison loss and the feature reconstruction loss, and perform gradient descent based on the total loss to enable the encoder to learn the optimized encoder.
[0050] Beneficial technical effects:
[0051] 1. While maintaining the advantage of self-supervised learning that does not require manual annotation, this application significantly improves the adaptability of graph neural networks in downstream tasks and solves the core defects of traditional mask graph autoencoders, such as semantic bias caused by masks, lack of directional semantic guidance in the reconstruction process, and interference from noisy neighbors in the aggregation process.
[0052] 2. This application does not require complex adversarial generative networks or cumbersome data augmentation operations. The training process is stable and efficient, and only the encoder is needed to obtain high-quality node representations during the inference phase.
[0053] 3. The proposed solution can be widely applied to scenarios such as graph data mining with scarce labels, social network analysis, cold start of recommendation systems, and bioinformatics network analysis, and has significant technical advantages and practical value. Attached Figure Description
[0054] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart of the mask graph autoencoder learning method based on directed semantic prompting according to an embodiment of this application;
[0056] Figure 2 This is a model architecture diagram of a mask graph autoencoder based on directed semantic prompting, according to an embodiment of this application. Detailed Implementation
[0057] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0058] To address the problems in the background technology, this application provides a learning method and system for a masked graph autoencoder based on directed semantic prompts, aiming to solve the semantic bias problem caused by node feature masks in existing technologies. The main objectives achieved are as follows:
[0059] 1. By introducing directed semantic hints, a unidirectional information flow from high-level semantically similar nodes is provided to the mask nodes, correcting the semantic offset in the aggregation process.
[0060] 2. Utilize the latent representation generated by the momentum target encoder instead of the original features to calculate similarity, in order to capture deeper structural and contextual semantics.
[0061] 3. By combining feature reconstruction tasks with latent representation comparison tasks, the robustness of graph representation learning and the accuracy of downstream tasks (such as node classification and clustering) can be improved.
[0062] To achieve the above objectives, this application primarily employs a directed semantic cueing mechanism, similarity calculation based on latent representation, and an online-target dual-stream collaborative architecture. Compared to existing technologies, it offers the following advantages: 1) Unlike existing undirected edge enhancement, the directed edges added in this application allow information to flow only from semantically similar nodes to mask nodes. This asymmetric design aligns with the logic of mask recovery: mask nodes require assistance, while complete similar nodes do not need to be disturbed by noise from mask nodes; 2) Existing technologies mostly calculate similarity based on original features, while this application utilizes the latent representation output by the target encoder to calculate similarity. The latent representation, aggregated by GNN, contains structural and contextual information, reflecting the true semantics of nodes better than the original features; 3) By combining generative tasks (reconstruction) and contrastive tasks (latest space alignment), the target network provides stable semantic anchors, guiding the online network to learn robust representations even in the presence of mask and cueing edges.
[0063] Example 1:
[0064] The mask graph autoencoder learning method based on directed semantic prompts described in this application's embodiments is essentially based on utilizing the latent semantics generated by the target network as guidance to construct an asymmetric prompt structure to assist in mask reconstruction. For example... Figure 1 As shown, the specific implementation plan includes the following detailed steps:
[0065] Step S1: Construct the online network and the target network on the computing processing unit;
[0066] Specifically, stable semantic guidance is achieved by constructing two parallel network branches with identical structures but different parameter update methods:
[0067] Because the purpose of the encoder is to learn knowledge from the original graph; in the target network, the original graph is used, and the target network is used to calculate the similarity of node representations and to align the online network with the target network through the latent representation of the original graph; therefore, this embodiment designs network branches with the same structure but different parameter update methods.
[0068] Target Stream: Contains the target encoder. (Target Encoder) and Target Projector (Target Projector). This branch is used to generate stable semantic references, and its parameters... Instead of updating via gradient backpropagation, updates are performed using the exponential moving average (EMA) of the online network parameters. The update formula is:
[0069] ;
[0070] in, This is the momentum coefficient, used to control the smoothness of the update. For target network parameters ; These are online network parameters.
[0071] Online Stream: Includes an online encoder. (Online Encoder), Online Projector (Online Projector) and Decoder (Decoder). This branch is responsible for processing the masked and cue-enhanced graph data and updating the parameters using gradient descent, a common technique in deep learning, which will not be detailed here.
[0072] Step S2: Input the original graph into the encoder of the target network. The encoder of the target network aggregates the neighborhood information of the nodes and outputs the node representation of the original graph.
[0073] This step primarily involves generating the target latent semantic benchmark; specifically, it involves transforming the original, unmasked graph... Momentum encoder input to target network The encoder aggregates the neighborhood information of nodes and outputs the latent representation matrix of the nodes. .
[0074] Here It contains complete high-level semantic and structural information of nodes in their undamaged (unmasked) state, serving as a benchmark for subsequent semantic similarity calculations.
[0075] Step S3: Construct a directed semantic hint graph using the node representations of the original graph as mask nodes;
[0076] This step aims to use the latent representation of the target network as a mask node to find semantic substitutes and establish directed information channels.
[0077] Random node masking: setting the mask rate Randomly sample nodes from the original graph and mask them to form a masked node set. For the selected mask node , and its feature vector Replace with a learnable mask vector The feature matrix after masking is obtained. .
[0078] Latent semantic similarity calculation: using the online latent representation obtained in step S2 Calculate each mask node Compared with the j-th node in the set of all other nodes in the original graph Cosine similarity between The calculation formula is as follows:
[0079]
[0080] in, , Let i be the i-th mask node in the set of mask nodes; The j-th node in the set of all nodes; For the set of mask nodes; Let be the cosine similarity between the i-th and j-th mask nodes in the feature matrix of the mask nodes; For the set of all nodes; Let i be the node representation of the i-th mask node; Let j be the node representation of the j-th node; Let be the magnitude of the vector representing the node of the i-th mask node; Let be the magnitude of the vector representing the node of the j-th node.
[0081] This can be understood as follows: in a masked graph, the set of all nodes contains both masked and unmasked nodes, where the j-th node... It could be a masked node or a non-masked node.
[0082] This step utilizes high-level latent semantics rather than raw features to calculate similarity, which can more accurately capture the semantic relationships between nodes.
[0083] Top-K node selection and directed edges: For each mask node Sort all similarity values in the similarity matrix from highest to lowest; select the top K similarity nodes (excluding the node itself) from the sorted similarity matrix as "hint nodes". Construct directed edges: add edges from this point to the mask graph. Each cue node has a directed edge pointing to the mask node. The resulting graph is called a "directed semantic cue graph". .
[0084] Technical principle: The directed edge design ensures that the information flow is asymmetric, that is, high-quality semantic information can only flow to the mask node to assist in reconstruction, while preventing the noise of the mask node from back-polluting the representation of the prompt node.
[0085] Step S4: Input the directed semantic cue graph into the encoder of the online network to obtain the online node representation. After masking the masked node portion of the online node representation, input it into the decoder of the online network to predict the original features of the masked nodes, and obtain the predicted features of the masked nodes; specifically including the following steps:
[0086] Step S4.1: Hint Enhancement Coding:
[0087] Directed semantic cue graph Input Online Encoder , obtain online potential representation By introducing directed cue edges, mask nodes can overcome local topological constraints during aggregation and obtain high-confidence feature information from semantically similar distant neighbors.
[0088] Step S4.2: Feature Re-masking:
[0089] To prevent the decoder from "cheating" directly through the identity mapping, the latent representation of the corresponding mask node position in H' is explicitly set to zero before decoding, resulting in... : This step forces the decoder to rely on the context and cue information learned by the encoder to make inferences.
[0090] Step S4.3: Decoding and Reconstruction:
[0091] The representation after remasking Input Decoder Reconstruct the predicted features of the mask nodes .
[0092] Step S5: Input the online node representation into the projector of the online network to obtain the online latent representation, and input the node representation of the original graph into the projector of the target network to obtain the target latent representation; calculate the latent representation contrast loss based on the online latent representation and the target latent representation; calculate the feature reconstruction loss based on the difference between the predicted features of the masked nodes and the original features of the masked nodes; calculate the total loss based on the latent representation contrast loss and the feature reconstruction loss, and perform gradient descent based on the total loss to enable the encoder to learn the optimized encoder.
[0093] Specifically, this application performs latent representation comparison and joint optimization, and adopts a multi-task joint optimization strategy to achieve the reconstruction of the feature space and the alignment of the latent space.
[0094] Step S5.1: Latent representation mapping:
[0095] Output of online network and the output of the target network By inputting the corresponding projectors, online latent representations can be obtained. and target potential representation .
[0096] Step S5.2: Loss function calculation:
[0097] Feature Reconstruction Loss : Calculate reconstructed features using Scaled Cosine Error With original features The difference between them is expressed by the formula:
[0098] ;
[0099] in, This is the scaling factor; The number of mask nodes; Let i be the i-th mask node in the set of mask nodes; For the set of mask nodes; It is the vector transpose of the original features of the i-th mask node; The predicted features of the i-th mask node; Let be the magnitude of the vector of the original features of the i-th mask node; Let be the magnitude of the vector of predicted features of the i-th mask node.
[0100] Potential representation of contrast loss : Calculate the consistency between the predicted representation of the mask node and the target representation in the latent space:
[0101] ;
[0102] This is the scaling factor; The number of mask nodes; Let i be the i-th mask node in the set of mask nodes; For the set of mask nodes; Let be the potential representation of the i-th mask node after projection into the online network; Let be the latent representation of the i-th mask node after projection into the target network; T is the vector transpose. Let be the modulus of the latent representation of the i-th mask node after projection into the online network; Let be the modulus of the potential representation of the i-th mask node after projection into the target network.
[0103] This loss forces the online network to still learn stable semantics consistent with the target network even under masking interference.
[0104] Calculate total loss : Summing the feature reconstruction loss and the latent representation contrast loss;
[0105] ;
[0106] in, This is the balance coefficient.
[0107] The essential goal and principle of the learning method applied in this application are as follows: Figure 2 As shown, a "prediction-correction" learning process is constructed, enabling the model to accurately infer the features of missing nodes based on partially known graph information, thereby learning the latent semantic relationships between nodes during this inference process. The model repeatedly executes the following process during the training phase:
[0108] 1) Mask the features of some nodes; 2) Use the unmasked nodes and their relationship information to predict the features of the masked nodes; 3) Compare the prediction results with the true features and adjust the model parameters accordingly.
[0109] The aforementioned loss function represents the prediction error of the model in the current training state. A smaller value indicates that the model's reconstruction of the masked node features is closer to the true value; a larger value indicates a larger prediction error. By calculating the loss function, the model's prediction performance can be transformed into an optimizable numerical objective. Using a pre-defined optimization algorithm, the parameters in the encoder and decoder are adjusted based on the gradient information of the model parameters from the loss function, so that the error of the next feature prediction is reduced compared to the current state. After training, the online encoder can output a low-dimensional vector representation corresponding to each node, which simultaneously encodes the node's structural and semantic information. This node representation can be directly used as input for node classification, node clustering, or other graph data analysis tasks without additional annotation. This application, through a clear process of node feature masking, semantic cue construction, feature reconstruction, and loss optimization, forms a complete and implementable generative self-supervised graph representation learning method. Those skilled in the art can directly implement the scheme of this application based on the content of this specification.
[0110] Example 2:
[0111] This application provides a mask graph autoencoder learning system based on directed semantic prompts, including:
[0112] A dual-stream network architecture module is used to build an online network and a target network on the computing processing unit;
[0113] The potential benchmark generation module is used to input the original graph into the encoder of the target network. The encoder of the target network aggregates the neighborhood information of the nodes and outputs the node representation of the original graph.
[0114] The semantic hint graph construction module is used to construct a directed semantic hint graph by using the node representations of the original graph as mask nodes;
[0115] The feature reconstruction module is used to input the directed semantic cue graph into the encoder of the online network to obtain the online node representation, and then mask the masked node part in the online node representation again before sending it into the decoder of the online network to predict the original features of the masked nodes, thereby obtaining the predicted features of the masked nodes.
[0116] The loss calculation module is used to input the online node representations into the projector of the online network to obtain the online latent representation, and input the node representations of the original graph into the projector of the target network to obtain the target latent representation; calculate the latent representation comparison loss based on the online latent representation and the target latent representation; calculate the feature reconstruction loss based on the difference between the predicted features of the masked nodes and the original features of the masked nodes; calculate the total loss based on the latent representation comparison loss and the feature reconstruction loss, and perform gradient descent based on the total loss to enable the encoder to learn the optimized encoder.
[0117] The mask graph autoencoder learning system based on directed semantic prompting provided in this embodiment has the same technical features as the mask graph autoencoder learning method based on directed semantic prompting provided in Embodiment 1, so it can also solve the same technical problems and achieve the same technical effects.
[0118] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0119] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0120] In the embodiments provided in this application, it should be understood that the disclosed systems / terminal devices and methods can be implemented in other ways. For example, the system / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection of systems or units may be electrical, mechanical, or other forms.
[0121] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
[0122] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the scope of the technology disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application.
Claims
1. A mask graph autoencoder learning method based on directed semantic prompts, characterized in that, include: On the computing processing unit, online networks and target networks are constructed; The original graph is input into the encoder of the target network. The encoder of the target network aggregates the neighborhood information of the nodes and outputs the node representation of the original graph. A directed semantic cue graph is constructed using the node representations of the original graph as mask nodes; The directed semantic cue graph is input into the encoder of the online network to obtain the online node representation. The masked node part in the online node representation is masked again and then sent to the decoder of the online network to predict the original features of the masked nodes, thus obtaining the predicted features of the masked nodes. The online node representations are input into the projector of the online network to obtain the online latent representation, and the node representations of the original graph are input into the projector of the target network to obtain the target latent representation. The latent representation contrast loss is calculated based on the online latent representation and the target latent representation. The feature reconstruction loss is calculated based on the difference between the predicted features of the masked nodes and the original features of the masked nodes. The total loss is calculated based on the latent representation contrast loss and the feature reconstruction loss, and gradient descent is performed based on the total loss to enable the encoder to learn the optimized encoder.
2. The mask graph autoencoder learning method based on directed semantic prompting according to claim 1, characterized in that, The parameters of the online network are updated using gradient descent, and the parameters of the target network are updated using the exponential moving average of the online network parameters.
3. The mask graph autoencoder learning method based on directed semantic prompting according to claim 1, characterized in that, The construction of a directed semantic hint graph using the node representations of the original graph as mask nodes specifically includes: Randomly sample nodes from the original graph and mask them to obtain a set of masked nodes; The feature vectors of the mask nodes in the mask node set are replaced with learnable mask vectors to obtain the feature matrix of the mask nodes. Using the node representation of the original graph, calculate the cosine similarity between each mask node and other nodes in the original graph to obtain the similarity matrix; Based on the similarity matrix, a directed semantic cue graph is constructed.
4. The mask graph autoencoder learning method based on directed semantic prompting according to claim 3, characterized in that, The cosine similarity between each mask node and other nodes in the original graph is calculated using the following formula: ; in, Let i be the i-th mask node in the set of mask nodes; The j-th node in the set of all nodes; For the set of mask nodes; for Cosine similarity; For the set of all nodes; Let i be the node representation of the i-th mask node; Let j be the node representation of the j-th node; Let be the magnitude of the vector representing the node of the i-th mask node; Let be the magnitude of the vector representing the node of the j-th node.
5. The mask graph autoencoder learning method based on directed semantic prompting according to claim 3, characterized in that, The step of constructing a directed semantic cue graph based on the similarity matrix includes: For any mask node Sort all similarity values in the similarity matrix from highest to lowest; select the top K similarity nodes as prompt nodes; the top K similarity nodes do not include mask nodes. itself; Add a pointer from the prompt node to any of the mask nodes in the mask image. By considering the directed edges, we obtain a directed semantic hint graph.
6. The mask graph autoencoder learning method based on directed semantic prompting according to claim 1, characterized in that, The process of re-masking the masked node portion in the online node representation and then feeding it into the decoder of the online network to predict the original features of the masked nodes, thereby obtaining the predicted features of the masked nodes, includes: Set the online node representation at the corresponding mask node position to zero; The zeroed-out online node representations are input into the online network decoder to reconstruct the predicted features of the mask nodes.
7. The mask graph autoencoder learning method based on directed semantic prompting according to claim 2, characterized in that, The parameters of the target network are updated using the exponential moving average of the online network parameters, calculated as follows: ; in, The momentum coefficient, ; For target network parameters ; These are online network parameters.
8. The mask graph autoencoder learning method based on directed semantic prompting according to claim 1, characterized in that, The latent representation contrast loss is calculated based on the online latent representation and the target latent representation; the calculation formula is as follows: ; in, This represents the potential contrast loss; This is the scaling factor; The number of mask nodes; Let i be the i-th mask node in the set of mask nodes; For the set of mask nodes; Let be the potential representation of the i-th mask node after projection into the online network; Let be the latent representation of the i-th mask node after projection into the target network; T is the vector transpose. Let be the modulus of the latent representation of the i-th mask node after projection into the online network; Let be the modulus of the potential representation of the i-th mask node after projection into the target network.
9. The mask graph autoencoder learning method based on directed semantic prompting according to claim 1, characterized in that, The feature reconstruction loss is calculated based on the difference between the predicted features of the masked node and the original features of the masked node, as shown in the following formula: ; in, For feature reconstruction loss; The number of mask nodes; This is the scaling factor; Let i be the i-th mask node in the set of mask nodes; For the set of mask nodes; It is the vector transpose of the original features of the i-th mask node; The predicted features of the i-th mask node; Let be the magnitude of the vector of the original features of the i-th mask node; Let be the magnitude of the vector of predicted features of the i-th mask node.
10. A mask graph autoencoder learning system based on directed semantic prompts, characterized in that, include: A dual-stream network architecture module is used to build an online network and a target network on the computing processing unit; The potential benchmark generation module is used to input the original graph into the encoder of the target network. The encoder of the target network aggregates the neighborhood information of the nodes and outputs the node representation of the original graph. The semantic hint graph construction module is used to construct a directed semantic hint graph by using the node representations of the original graph as mask nodes; The feature reconstruction module is used to input the directed semantic cue graph into the encoder of the online network to obtain the online node representation, and then mask the masked node part in the online node representation again before sending it into the decoder of the online network to predict the original features of the masked nodes, thereby obtaining the predicted features of the masked nodes. The loss calculation module is used to input the online node representations into the projector of the online network to obtain the online latent representation, and input the node representations of the original graph into the projector of the target network to obtain the target latent representation; calculate the latent representation comparison loss based on the online latent representation and the target latent representation; calculate the feature reconstruction loss based on the difference between the predicted features of the masked nodes and the original features of the masked nodes; calculate the total loss based on the latent representation comparison loss and the feature reconstruction loss, and perform gradient descent based on the total loss to enable the encoder to learn the optimized encoder.