Sub-graph matching method and related equipment based on contrastive learning of dense perceptual graphs
Through the self-supervised learning method based on dense perceptual graph comparison learning, the existing subgraph matching method has solved the problem of high computational complexity and dependence on labeled data in large-scale or dynamic graph processing, and achieved a more accurate and efficient subgraph matching effect.
Patent Information
- Application Number
- CN202411756558.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-03
AI Technical Summary
The existing subgraph matching methods have high computational complexity when processing large-scale or dynamic graphs, and rely on labeled data, poor label quality or high labeling costs, resulting in poor model effectiveness.
Using a method based on intensive perceptual graph comparison learning, self-supervised graph representation learning does not require explicit labels, and graph structures are embedded in high-dimensional vectors using graph isomorphic networks, and sub-graph matching is achieved through the comparison loss function.
This method can learn effective subgraph representations under limited labels, avoid dependence on large amounts of labeled data, improve the accuracy and efficiency of subgraph matching, and is suitable for processing large-scale and dynamic graphs.
Smart Images

Figure CN119229152B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of graph computing technology, and specifically relates to a subgraph matching method based on dense perceptual graph contrast learning and related equipment. Background Art
[0002] With the advent of the big data era, massive multi-source heterogeneous data from social networks, Web networks, biological data and life are being generated and accumulated at an unprecedented rate. These data are closely related. How to effectively analyze and mine them is a severe challenge and important opportunity currently faced by the industry and academia. As a widely used data structure, graphs are very suitable for characterizing such data with intrinsic correlations. The purpose of subgraph matching is to establish structural alignment between two input graphs, where the smaller query graph is isomorphic to a subset of the larger target graph. Subgraph matching problems are widely used, such as mining target group customers in social networks; assisting the analysis of proteins of unknown properties in the field of biological analysis; finding attack activities in network log traceability graphs to protect the security of network environments, etc.
[0003] The subgraph matching problem is an NP-hard problem (a non-deterministic problem of polynomial complexity). When the amount of graph data is too large or when the graph changes, a large amount of computational overhead and storage overhead are required, which poses a huge challenge to computing power. The traditional method is usually a combinatorial optimization method that aims to identify all exact matches. However, when dealing with large graphs, the computational complexity increases exponentially as the graph size grows. In particular, when the graph changes, it is necessary to start the calculation from scratch, which further increases the computational difficulty. In order to solve the computational burden of subgraph matching in dynamic graphs and large-scale graphs, some scholars have emphasized the importance of scalability and explored preprocessing strategies, including indexing the locations of small graph components and then decomposing the query into these components. As the size of the query graph increases, the complexity of the decomposition process increases, which limits the actual efficiency and applicability of traditional algorithms. Although these methods have achieved improvements in scalability, further in-depth exploration and research are still needed to overcome the limitations encountered when dealing with larger and more complex queries.
[0004] Currently, most studies prioritize learning-based methods as the main strategy, recognizing their potential to revolutionize subgraph matching. The solution is to frame it as a supervised learning task, leveraging the powerful representation capabilities of graph neural networks (GNNs). Recent studies have explored this approach and demonstrated its potential to improve the efficiency and accuracy of subgraph matching tasks and graph similarity calculation tasks. However, these methods inherently rely on supervised learning and require labeled data for training. This reliance on labeled data brings significant limitations, and when the quality of labels is poor, it will significantly affect the results of training. Moreover, in most real-world situations, the process of labeling such data often proves to be impractical and costly. In general, existing subgraph matching methods are still mainly focused on combinatorial optimization methods, resulting in the inability to solve NP-hard problems and high computational overhead. However, methods using graph representation learning rarely consider the sparsity of labels in the subgraph matching process, resulting in a large degree of reliance on label accuracy, and the model cannot judge the subgraph matching effect well. Summary of the invention
[0005] In response to the above problems, the present invention provides a subgraph matching method, system, electronic device and storage medium based on dense perceptual graph contrast learning, aiming to effectively capture the inherent similarities between the original graph and its substructures, thereby promoting more accurate and robust subgraph matching.
[0006] According to a first aspect of an embodiment of the present disclosure, a subgraph matching method based on dense perceptual graph contrast learning is provided, comprising the following steps:
[0007] For the initialized subgraphs in the graph dataset, a random subgraph enhancement method or a dense subgraph enhancement method is used to obtain positive sample subgraphs and non-subgraph negative samples;
[0008] Establishing a graph representation learning embedding model, which is based on a graph neural network framework and uses a graph isomorphism network as an encoder to embed the graph structure into a high-dimensional vector;
[0009] The positive sample subgraph and the non-subgraph negative sample are respectively input into the graph representation learning embedding model to obtain two embedding vectors, and the two embedding vectors are concatenated and then the result of the graph representation learning embedding model is verified using an SVM classifier.
[0010] In some embodiments, the random subgraph enhancement method is a node discarding and edge discarding method or a feature masking method; the dense subgraph enhancement method is a random walk method or a k-core and k-truss subgraph method.
[0011] In some embodiments, the encoder includes multiple graph isomorphic network layers, fully connected layers and pooling layers; over-smoothing is avoided by setting the number of graph isomorphic network layers.
[0012] In some embodiments, the method further includes training the graph representation learning embedding model, using an encoder and a projection head based on a graph neural network for training, maximizing expression consistency through a contrast loss function, and continuously optimizing the parameters of the encoder and the projection head.
[0013] In some embodiments, when testing the graph representation learning embedding model, two graphs in the marked test set are input into the trained graph representation learning embedding model, and the two output embedding vectors are spliced; the relationship between the two graphs is determined based on the spliced vectors.
[0014] In some embodiments, the graph representation learning embedding model implements embedding representation in a graph isomorphic network by iteratively aggregating and updating nodes layer by layer, specifically including the following steps:
[0015] For l Layer Node The aggregation information is obtained by performing an aggregation operation on the node representations in the neighbor set of the node;
[0016] For nodes In the l +1 layer of aggregated information update representation, through the graph isomorphic network learnable parameters, l Layer Node Aggregate information update representation and the l Layer Node The aggregated information is obtained by the multi-layer perceptron function MLP calculation.
[0017] In some embodiments, the contrast loss function is an InfoNCE loss function.
[0018] According to a second aspect of an embodiment of the present disclosure, a subgraph matching system based on dense perceptual graph contrast learning is provided, the system comprising:
[0019] A subgraph enhancement module is used to obtain positive sample subgraphs and non-subgraph negative samples using a random subgraph enhancement method or a dense subgraph enhancement method for the initialized subgraphs in the graph dataset;
[0020] Establishing a graph representation learning embedding model module, which is used to establish a graph representation learning embedding model. The graph representation learning embedding model is based on a graph neural network framework and uses a graph isomorphism network as an encoder to embed the graph structure into a high-dimensional vector;
[0021] The model training and testing module is used to input the positive sample subgraph and the non-subgraph negative sample into the graph representation learning embedding model respectively to obtain two embedding vectors, and then concatenate the two embedding vectors to verify the results of the graph representation learning embedding model using an SVM classifier.
[0022] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the above-mentioned sub-graph matching method based on dense perceptual graph contrast learning are implemented.
[0023] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the above-mentioned sub-graph matching method based on dense perceptual graph contrast learning are implemented.
[0024] The embodiments of the present disclosure provide a subgraph matching method, system, electronic device and storage medium based on dense perceptual graph contrast learning, which can learn meaningful representations without explicit labels through self-supervised graph representation learning. Furthermore, different subgraph enhancement methods are used to ensure that the contrast view is a subgraph of the original image, so that the vector of the original image is as close as possible to the vector of the enhanced image (subgraph) in the high-dimensional vector space. Then, the goal of the graph contrastive learning (GCL) training process is to maximize the mutual information between the two view vectors, so that the representations of the original image and its subgraphs are closer in the contrast feature space, while further separating the representations of the original image and other non-subgraphs. This contrastive learning encourages the model to learn embedding, effectively captures the inherent similarities between the original image and its substructure, and thus promotes more accurate and robust subgraph matching. Specifically, the beneficial effects of the present invention mainly include:
[0025] 1. This paper integrates graph contrast learning (GCL) into the subgraph matching method for the first time. In real applications, there are often limited labels, and this method can learn effective subgraph representations in a self-supervised manner under such conditions. This self-supervised learning method avoids the reliance on a large amount of labeled data and provides a new idea and method for solving the subgraph matching problem;
[0026] 2. The present invention is based on the fact that random enhancement is not applicable in some cases, and random enhancement may damage the intrinsic properties of the data and affect the learning effect of the model. Specifically, the following problems are involved: when both nodes and edges carry important structural information, randomly discarding nodes and edges may destroy the original structure of the network; nodes and edges also play the role of information propagation in the network, and randomly discarding nodes and edges may block the normal propagation path of information; nodes and edges often have some attribute characteristics. In architectures used for contrastive learning such as graph neural networks, the characteristics of nodes and edges will participate in the representation learning of nodes and graphs, and randomly discarding nodes and edges will cause distortion of special representations; for contrastive learning models, the stability and integrity of data are crucial to the training and convergence of the model. Randomly discarding nodes and edges will introduce uncertainty and instability in the data, resulting in difficulty in model convergence. Based on this, the present invention proposes a dense subgraph enhancement strategy (i.e., training, updating and testing the model). Through this enhancement method, the data can be better processed on the basis of retaining the intrinsic properties of the data, and the model's learning ability for data features can be improved, thereby improving the accuracy and efficiency of subgraph matching.
[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0029] Figure 1 It is a flowchart of a sub-graph matching method based on dense perceptual graph contrast learning in an embodiment of the present invention;
[0030] Figure 2 The figure shows a block diagram of an encoder in a learning embedding model according to an embodiment of the present invention;
[0031] Figure 3 The figure is a schematic diagram of the logic method of each GIN layer in the learning embedding model encoder in an embodiment of the present invention;
[0032] Figure 4 It is an overall block diagram of a sub-graph matching method based on dense perceptual graph contrast learning in an embodiment of the present invention;
[0033] Figure 5 is a schematic diagram of the structure of a sub-graph matching system based on dense perceptual graph contrast learning in an embodiment of the present invention;
[0034] Figure 6 It is a schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0036] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0037] Given that the process of labeling data has proven to be impractical and costly in most real-world scenarios, this paper aims to explore self-supervised learning methods as a viable alternative. The integration of self-supervised learning and graph neural networks (GNNs) has shown great potential in this context, providing a potential path to address the challenges posed by relying on labeled data. By leveraging the inherent structures and patterns in unlabeled graph data, self-supervised GNNs can learn meaningful representations without explicit labels. This technique, known as contrastive graph learning (GCL), has attracted significant attention due to its potential to overcome the limitations associated with the dependency on labeled data. By cleverly capturing the topological relationships and characteristic features of the graph, self-supervised GNNs are able to derive rich and meaningful representations, which are crucial for effectively performing various graph-based tasks, such as subgraph matching, anomaly detection, and link prediction.
[0038] The embodiment of the present invention addresses the problem that subgraph matching is a typical NP-hard problem with high computational complexity and difficulty in processing large-scale graphs and dynamic graphs. Therefore, graph representation learning is used to determine subgraph relationships. The subgraph matching representation learning method determines subgraph relationships and depends on label quality. Therefore, comparative learning (self-supervised learning method) is used through graph enhancement to avoid labeling and automatically learn subgraph matching relationships.
[0039] The following embodiments are provided for a sub-graph matching method, system, electronic device and storage medium based on dense perceptual graph contrast learning:
[0040] This embodiment is used to illustrate a sub-graph matching method based on dense perceptual graph contrast learning. Figure 1 As shown, the following steps are included:
[0041] S1. For the initialized subgraphs in the graph dataset, use the random subgraph enhancement method or the dense subgraph enhancement method to obtain positive sample subgraphs and non-subgraph negative samples;
[0042] S2. Establish a graph representation learning embedding model, which is based on a graph neural network framework and uses a graph isomorphism network as an encoder to embed the graph structure into a high-dimensional vector;
[0043] S3. Input the positive sample subgraph and the non-subgraph negative sample into the graph representation learning embedding model respectively to obtain two embedding vectors, concatenate the two embedding vectors and use an SVM classifier to verify the result of the graph representation learning embedding model.
[0044] Random subgraph enhancement methods or dense subgraph enhancement methods are used to ensure that the enhanced graph is a subgraph of the original graph. Random subgraph enhancement methods include but are not limited to node discarding and edge discarding methods or feature masking methods; dense subgraph enhancement methods include but are not limited to random walk methods or k-core and k-truss subgraph methods.
[0045] Stochastic Augmentation: Node Drop and Edge Drop: Set the probability of node drop or edge drop operation for the augmented graph of the original graph, the probability of retaining each node and edge in the graph, and then randomly remove nodes and edges according to Bernoulli distribution. The existing method can continue to run with the newly determined probability without other modifications. Feature Mask: Feature mask does not change the graph structure, prompting the model to learn with fewer node features and more structural information, set the probability of node feature mask, and then the node features are masked by normal distribution.
[0046] Dense Subgraph Augmentation: Random Walk Sample: Use random walks to sample subgraphs from it, with the basic assumption that the semantics of can be largely preserved in its (partial) local structure; K-core and K-truss subgraphs: K-core ensures that each node in the subgraph has at least one neighbor (denoted as), maintaining basic connectivity; K-truss ensures that each edge is part of at least triangles, capturing local clustering structure.
[0047] Figure S2 shows the learned embedding model as Figure 2 , Figure 3 As shown, the encoder includes multiple graph isomorphic network layers, fully connected layers and pooling layers; over-smoothing is avoided by setting the number of graph isomorphic network layers.
[0048] Generally, traditional GNN follows the message passing neural network (MPNN) framework, where local information is aggregated and passed to neighbors. The inventors chose the graph isomorphism network (GIN) as the encoder.
[0049] ,
[0050] ,
[0051] A key advantage of GIN is that it uses a learnable parameter ,This parameter controls the influence of the node’s own representation. In the process of information aggregation, different nodes may have different importance, and the contribution of each node’s own representation in the overall information aggregation can be dynamically adjusted according to the learned pattern.
[0052] S3 draws inspiration from recent advances in contrastive learning of visual representations and introduces a novel approach to extend this concept to subgraph representation learning, such as Figure 4 As shown, the process includes:
[0053] In the training phase: First, the input graph is enhanced to obtain a subgraph from the original graph. Then, a shared encoder containing multiple GNN layers is used based on the graph neural network (GNN). and projection head By contrasting the loss function, the consistency between the representation and is maximized, thereby continuously optimizing the parameters of the encoder and projection head to better learn the feature representation of the graph.
[0054] In the test phase, for the two images in the labeled test set, they are input into the trained encoder , and get two corresponding vectors. Then, concatenate the two vectors. Finally, determine the relationship between the two graphs based on the concatenated vectors to determine whether they have a certain association or similarity.
[0055] The specific implementation steps of S1 include:
[0056] S11. Initialization operation: In the graph dataset, it is divided into different batches. For each batch, a graph is selected and the node set of the subgraph is initialized. and ,in represents the set of points of the subgraph, A set of edges representing a subgraph.
[0057] S12. Create positive and negative samples: Create positive sample subgraphs by random subgraph enhancement or dense subgraph enhancement. Randomly select other graphs in this batch as non-subgraph negative samples.
[0058] S13, storage verification: store the samples for subsequent testing and verification.
[0059] The specific implementation steps of S2 include:
[0060] S21. In information aggregation, for each layer , first calculate the node aggregation information , by node The neighbor set The nodes in Perform aggregation Operation obtained.
[0061] S22, updating nodes using aggregate information exist Layer Representation , the specific method is to use the multi-layer perceptron function MLP to For processing. is a parameter of the science department that controls the contribution of the node's own representation.
[0062] By repeating the above steps, GIN iteratively aggregates and updates node embeddings layer by layer. In this process, it can capture the properties of the overall graph while retaining detailed subgraph information, thereby achieving effective analysis and processing of the graph.
[0063] The graph representation learning embedding model implements the embedding representation by iteratively aggregating and updating nodes layer by layer in the graph isomorphic network. Specifically, it includes the following steps:
[0064] For l Layer Node The aggregation information is obtained by performing an aggregation operation on the node representations in the neighbor set of the node;
[0065] For nodes In the The aggregate information update representation of the layer is obtained by learning the parameters of the graph isomorphic network. Layer Node Aggregate information update representation and the l Layer Node The aggregated information is obtained by the multi-layer perceptron function MLP calculation.
[0066] Specifically, the implementation steps of S3 include:
[0067] S31, sub-graph data enhancement, given a graph , use one of the sub-graph enhancement methods to obtain the enhanced graph. One is the original graph , and the other is the enhanced graph . In addition, negative pairs are randomly selected from other graphs.
[0068] S32, the embedding model for graph representation learning uses a multi-layer GIN model;
[0069] S33, mapping projection to a new dimension (Projection head), the vector undergoes a nonlinear transformation, called , mapping them to different latent spaces.
[0070] S34, in the training phase, to promote the positive sample consistency, , Represent the embedding vectors of positive samples after contrastive learning, where Represents the original image, Represents the enhanced image and distinguishes it from the negative sample pair, defining a contrast loss function InfoNCE loss is used. During the pre-training of the graph neural network (GNN), a small batch of N graphs is randomly selected for contrastive learning. This process produces 2N enhanced graphs and their corresponding contrastive losses. For the b-th graph in the small batch, they are respectively and , where n represents the nth batch of data entering the model in deep learning, represents the original image, represents a subgraph, is the temperature coefficient in contrastive learning. Negative pairs are explicitly sampled from other augmented graphs in the same mini-batch.
[0071] ,
[0072] S35. In the verification phase, some graph pairs are marked with subgraph and non-subgraph relations. Their format is ( , , labels). Then, after concatenating the two embeddings, the trained GNN is used to compute and Finally, a linear SVM classifier based on graph embedding is trained to classify (is or is not a subgraph relationship). SVM uses 10-fold cross validation and repeats each experiment five times.
[0073] Another embodiment is used to illustrate a sub-graph matching system based on dense perceptual graph contrast learning, see Figure 5The system 400 includes: a subgraph enhancement module 410, which is used to obtain positive sample subgraphs and non-subgraph negative samples for the initialized subgraphs in the graph data set using a random subgraph enhancement method or a dense subgraph enhancement method; a graph representation learning embedding model establishment module 420, which is used to establish a graph representation learning embedding model, the graph representation learning embedding model is based on a graph neural network framework, and uses a graph isomorphism network as an encoder to embed the graph structure into a high-dimensional vector; a model training and testing module 430, which is used to input the positive sample subgraph and the non-subgraph negative sample into the graph representation learning embedding model respectively to obtain two embedding vectors, and after splicing the two embedding vectors, use an SVM classifier to verify the results of the graph representation learning embedding model.
[0074] In addition to the upper module, the system 400 may also include other components. However, since these components are irrelevant to the content of the embodiment of the present disclosure, their illustration and description are omitted here.
[0075] The other specific working processes of the sub-graph matching system 400 based on dense perceptual graph contrast learning refer to the description of the above-mentioned sub-graph matching method embodiment based on dense perceptual graph contrast learning, which will not be repeated here.
[0076] Another embodiment is used to illustrate that the system of the present invention can also be used with the help of Figure 6 The architecture of the computing device shown is implemented. Figure 6 The architecture of the computing device is shown. Figure 6 As shown, a computer system 510, a system bus 530, one or more CPUs 540, an input / output 520, a memory 550, etc. The memory 550 can store various data or files used for computer processing and / or communication and program instructions executed by the CPU including the sub-graph matching method based on dense perceptual graph contrast learning of the embodiment. Figure 6 The architecture shown is only exemplary and can be adjusted according to actual needs when implementing different devices. Figure 6 One or more components in. The memory 550, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the subgraph matching method based on dense perceptual graph contrast learning in the embodiment of the present invention (for example, the subgraph enhancement module 410, the graph representation learning embedding model module 420 and the model training and testing module 430 in the subgraph matching system 700 based on dense perceptual graph contrast learning). One or more CPUs 540 execute various functional applications and data processing of the system of the present invention by running the software programs, instructions and modules stored in the memory 550, that is, to implement the above-mentioned subgraph matching method based on dense perceptual graph contrast learning, which includes the following steps:
[0077] For the initialized subgraphs in the graph dataset, a random subgraph enhancement method or a dense subgraph enhancement method is used to obtain positive sample subgraphs and non-subgraph negative samples;
[0078] Establishing a graph representation learning embedding model, which is based on a graph neural network framework and uses a graph isomorphism network as an encoder to embed the graph structure into a high-dimensional vector;
[0079] The positive sample subgraph and the non-subgraph negative sample are respectively input into the graph representation learning embedding model to obtain two embedding vectors, and the two embedding vectors are concatenated and then the result of the graph representation learning embedding model is verified using an SVM classifier.
[0080] Of course, the processor of the server provided in the embodiment of the present invention is not limited to executing the method operations described above, but can also execute relevant operations in the sub-graph matching method based on dense perceptual graph contrast learning provided in any embodiment of the present invention.
[0081] The memory 550 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 550 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 550 may further include a memory remotely arranged relative to one or more CPUs 540, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0082] The input / output 520 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The input / output 520 may also include a display device such as a display screen.
[0083] The embodiment of the present invention also provides a non-temporary computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor, the subgraph matching method based on dense perceptual graph contrast learning described in the above embodiment is implemented. The computer-readable storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0084] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0085] The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.
[0086] In addition, other specific working processes of a non-temporary computer-readable storage medium refer to the description of the above-mentioned sub-graph matching method embodiment based on dense perceptual graph contrast learning, which will not be repeated here.
[0087] In summary, the technical solutions provided by the above embodiments include a subgraph matching method, system, electronic device and storage medium based on dense perceptual graph contrast learning. The embodiments of the present disclosure provide a subgraph matching method, system, electronic device and storage medium based on dense perceptual graph contrast learning, which can learn meaningful representations without explicit labels through self-supervised graph representation learning. Furthermore, different subgraph enhancement methods are used to ensure that the contrast view is a subgraph of the original image, so that the vector of the original image is as close as possible to the vector of the enhanced image (subgraph) in the high-dimensional vector space. Then, the goal of the graph contrast learning (GCL) training process is to maximize the mutual information between the two view vectors, so that the representations of the original image and its subgraphs are closer in the contrast feature space, while further separating the representations of the original image and other non-subgraphs. This contrast learning encourages the model to learn embedding, effectively captures the inherent similarities between the original image and its substructures, and thus promotes more accurate and robust subgraph matching. Specifically, the beneficial effects of the present invention mainly include:
[0088] 1. This paper integrates graph contrast learning (GCL) into the subgraph matching method for the first time. In real applications, there are often limited labels, and this method can learn effective subgraph representations in a self-supervised manner under such conditions. This self-supervised learning method avoids the reliance on a large amount of labeled data and provides a new idea and method for solving the subgraph matching problem;
[0089] 2. Based on the problem that random enhancement is not applicable in some cases and may damage the intrinsic properties of the data, affecting the learning effect of the model, the present invention proposes a dense subgraph enhancement strategy (i.e., training, updating and testing the model). Through this enhancement method, the data can be better processed while retaining the intrinsic properties of the data, thereby improving the model's ability to learn data features, thereby improving the accuracy and efficiency of subgraph matching.
[0090] In this document, the terms "comprises," "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, such that a step or method that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such step or method.
[0091] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A subgraph matching method based on contrastive learning of dense perceptual graphs, characterized in that: The following steps are involved: For the initialized subgraphs in the graph dataset, a random subgraph enhancement method or a dense subgraph enhancement method is used to obtain positive sample subgraphs and non-subgraph negative samples; Establishing a graph representation learning embedding model, which is based on a graph neural network framework and uses a graph isomorphism network as an encoder to embed the graph structure into a high-dimensional vector; The positive sample subgraph and the non-subgraph negative sample are respectively input into the graph representation learning embedding model to obtain two embedding vectors, and the two embedding vectors are concatenated and then the result of the graph representation learning embedding model is verified by using a classifier; The graph representation learning embedding model implements embedding representation by iteratively aggregating and updating nodes layer by layer in a graph isomorphic network, specifically including the following steps: For l Layer Node The aggregation information is obtained by performing an aggregation operation on the node representations in the neighbor set of the node; For nodes In the l +1 layer of aggregated information update representation, through the graph isomorphic network learnable parameters, l Layer Node Aggregate information update representation and the l Layer Node The aggregated information is obtained by the multi-layer perceptron function MLP calculation.
2. The subgraph matching method based on dense perceptual graph contrast learning according to claim 1, characterized in that: The random subgraph enhancement method is a node discarding and edge discarding method or a feature masking method; the dense subgraph enhancement method is a random walk method or a k-core and k-truss subgraph method.
3. The subgraph matching method based on dense perceptual graph contrast learning according to claim 1, characterized in that: The encoder includes multiple graph isomorphic network layers, fully connected layers and pooling layers; over-smoothing is avoided by setting the number of graph isomorphic network layers.
4. The subgraph matching method based on dense perceptual graph contrast learning according to claim 1, characterized in that: The method also includes training the graph representation learning embedding model, using an encoder and a projection head based on a graph neural network for training, maximizing expression consistency through a contrast loss function, and continuously optimizing the parameters of the encoder and the projection head.
5. The subgraph matching method based on dense perceptual graph contrast learning according to claim 1, characterized in that: When testing the graph representation learning embedding model, two graphs in the marked test set are input into the trained graph representation learning embedding model, and two embedding vectors obtained by output are concatenated; The SVM classifier is used to determine the relationship between the two graphs based on the concatenated vectors.
6. The subgraph matching method based on dense perceptual graph contrast learning according to claim 4, characterized in that: The contrast loss function is the InfoNCE loss function.
7. A sub-graph matching system based on contrastive learning of dense perceptual graphs, characterized in that: The system comprises: A subgraph enhancement module is used to obtain positive sample subgraphs and non-subgraph negative samples using a random subgraph enhancement method or a dense subgraph enhancement method for the initialized subgraphs in the graph dataset; Establishing a graph representation learning embedding model module, which is used to establish a graph representation learning embedding model. The graph representation learning embedding model is based on a graph neural network framework and uses a graph isomorphism network as an encoder to embed the graph structure into a high-dimensional vector; A model training and testing module, used to input the positive sample subgraph and the non-subgraph negative sample into the graph representation learning embedding model respectively to obtain two embedding vectors, and then concatenate the two embedding vectors to verify the result of the graph representation learning embedding model using a classifier; The graph representation learning embedding model implements embedding representation by iteratively aggregating and updating nodes layer by layer in a graph isomorphic network, specifically including the following steps: For l Layer Node The aggregation information is obtained by performing an aggregation operation on the node representations in the neighbor set of the node; For nodes In the l +1 layer of aggregated information update representation, through the graph isomorphic network learnable parameters, l Layer Node Aggregate information update representation and the l Layer Node The aggregated information is obtained by the multi-layer perceptron function MLP calculation.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the sub-graph matching method based on dense perceptual graph contrast learning as described in any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the sub-graph matching method based on dense perceptual graph contrast learning as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Structural perception graph comparative learning method based on adaptive subgraphs
CN115131605A
Compound property prediction method based on subgraph network and comparative learning
CN115511145A