Heterogeneous graph neural network training method and system based on community consistency

By generating sub-graph sets and designing MMD loss function, the problem of insufficient computational complexity and dynamic topological adaptability of traditional graph neural networks in super-large-scale heterogeneous graphs is solved, and more efficient training and more stable feature propagation are achieved.

CN120338028AActive Publication Date: 2025-07-18NORTHWESTERN POLYTECHNICAL UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510816770.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-07-18
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

Traditional graph neural networks have high computational complexity when processing super-large-scale heterogeneous graphs, insufficient dynamic topological adaptability, serious semantic collapse and feature confusion, and the evolution law of community structure has not been explicitly modeled.

Method used

A heterogeneous graph neural network training method based on community consistency, by generating a subgraph set, designing an MMD loss function, constructing a composite loss function, and updating parameters through gradient inversion to optimize the subgraph generation quality and feature distribution consistency.

Benefits of technology

When dealing with hyper-large-scale heterogeneous graphs, feature drift is reduced, training efficiency and structural stability of the model are improved, and dynamic topological adaptability and semantic fidelity are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120338028A_ABST
    Figure CN120338028A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of graph neural networks and heterogeneous data processing, and particularly discloses a heterogeneous graph neural network training method and system based on community consistency, and the method comprises the steps: generating a sub-graph set of a heterogeneous graph based on a community division rule; extracting a node feature matrix of each sub-graph in the sub-graph set, performing slicing operation on each node feature matrix to obtain a sub-graph feature matrix aligned with the input, and designing an MMD loss function; and constructing a composite loss function based on the MMD loss function, and updating parameters of the heterogeneous graph neural network through gradient inversion to complete heterogeneous graph neural network training. According to the method, the problem that a traditional graph neural network is insufficient in the aspects of cross-domain knowledge fusion, dynamic topology adaptability and semantic fidelity is solved through dynamic community division and a subgraph feature consistency constraint mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical fields of graph neural networks and heterogeneous data processing, and particularly relates to a training method and system for heterogeneous graph neural networks based on community consistency. Background Art

[0002] In the field of heterogeneous graph data processing, traditional graph models have an inherent defect of insufficient modeling of multi - relational dependencies. The Heterogeneous Graph Transformer (HGT) significantly improved the representation ability of heterogeneous networks at that time by introducing a meta - relational aware attention mechanism. The classic HGT architecture achieved differential interaction modeling between different types of nodes by distinguishing the relationship patterns of node types and edge types, and was verified in multiple fields such as academic network analysis. Subsequently, various improved methods developed optimized different dimensions respectively: the multi - scale semantic fusion method based on hierarchical aggregation improved the utilization rate of local topological information, the multi - tokenization extension scheme enhanced the ability to capture long - distance dependencies, and the dynamic scene adaptation method extended the application scope of the model to the field of time - varying graphs. However, existing HGT variants generally face a computational complexity bottleneck when dealing with ultra - large - scale heterogeneous graphs, and their adaptive ability to dynamic topologies still needs to be improved.

[0003] The existing heterogeneous graph neural networks mainly face the following technical problems: 1. Semantic collapse: During the multi - layer feature propagation process, the structured information of nodes within a community is easily interfered by noise, resulting in a distribution shift. 2. Feature confusion: The heterogeneous interaction between cross - type nodes weakens the topological continuity of homogeneous nodes. 3. Insufficient dynamic adaptation: The evolution law of community structures in large - scale graphs is not explicitly modeled. Summary of the Invention

[0004] The purpose of the present invention is to solve the problems of insufficient cross - domain knowledge fusion, dynamic topology adaptability, and semantic fidelity in traditional graph neural networks, and a training method and system for heterogeneous graph neural networks based on community consistency are proposed.

[0005] The technical solution of the present invention is as follows: In the first aspect, a training method for heterogeneous graph neural networks based on community consistency includes the following steps: Generating a set of sub - graphs of the heterogeneous graph based on community division rules; Extracting the node feature matrices of each sub - graph in the set of sub - graphs, performing slicing operations on each node feature matrix to obtain sub - graph feature matrices aligned with the input, and designing an MMD loss function; Constructing a composite loss function based on the MMD loss function, and updating the parameters of the heterogeneous graph neural network through gradient reversal to complete the training of the heterogeneous graph neural network.

[0006] Preferably, the set of subgraphs of the heterogeneous graph generated based on the community division rules is specifically as follows: According to the heterogeneous graph 's node type set Establish a homogeneous community division system for the node type whose corresponding homogeneous community is to obtain the complete community set wherein, represents the vertex set of the heterogeneous graph, represents the edge set; Construct a homogeneous node set and then obtain the common neighbor node set of the homogeneous community through two-step neighborhood expansion, wherein, represents the vertex set in the homogeneous node set, represents the node type mapping function, represents the edges of the cross-class common neighbors of the same type of nodes; Based on the common neighbor node set construct the node set of the subgraph ; Based on the common neighbor node set construct the edge set of the subgraph wherein, represents the homogeneous edges within the community, and there are , represents the heterogeneous edges across types, and there are wherein, represents the edge type mapping function, represents the homogeneous edges, represents the heterogeneous edges; Complete the construction of the node sets and edge sets of all subgraphs to obtain the subgraph set .

[0007] Preferably, when generating the set of subgraphs of the heterogeneous graph based on the community division rules, regularization constraints are independently applied to each subgraph to optimize the subgraph generation quality, specifically as follows: Adopt the spectral graph theory method to balance the cohesion and connectivity of the subgraph through the trace constraint of the Laplacian matrix. Let be the normalized Laplacian matrix of the subgraph , and its regularization term is defined as wherein, represents the node feature matrix, represents the trace of the Laplacian matrix, represents the transpose of the matrix, denotes the set of real numbers, denotes the node set of the sub - graph , denotes the dimension of the feature vector.

[0008] Preferably, according to the node set of the sub - graph re - index the original attribute features of the nodes of the heterogeneous graph , and then align the feature matrix through a predefined node - type mapping function . Specifically: perform a feature slicing operation on the node set in the community to generate an initial feature matrix of a specific type , where denotes the number of nodes, denotes the sub - script of the node type, denotes the initial feature vector of the node ; Input the initial feature matrix into the heterogeneous graph neural network, and perform iterative updates layer by layer. The output of the -th layer of the heterogeneous graph neural network is , where is the activation function, is the learnable weight, is the bias term, denotes the output of the -th layer of the heterogeneous graph neural network. When takes the value of 1, the output of the 0 - th layer of the heterogeneous graph neural network is , denotes the set of real numbers, denotes the dimension of the feature vector; Perform a type - projection operation on the inter - layer propagation of the heterogeneous graph neural network, and extract the sub - graph feature matrix of the -th layer of the heterogeneous graph neural network.

[0009] Preferably, the type - projection operation is specifically: for the feature sub - matrix corresponding to the community , extract the sub - graph feature matrix of the current layer through the type - filtering operator :

[0010] where denotes the feature vector corresponding to the node of the -th layer of the network.

[0011] Preferably, the designed MMD loss function is specifically as follows: Establish a reproducing kernel Hilbert space through a kernel function and calculate the expectation value of the internal kernel matrix of the initial feature matrix and the internal cohesion measure of the post-processing feature matrix respectively within the reproducing kernel Hilbert space; the post-processing feature matrix is ; Construct the cross-kernel matrix of the initial feature matrix and the post-processing feature matrix and then calculate the expected similarity between cross-stage samples; Construct the MMD loss function through the squared deviation according to the expectation value of the internal kernel matrix of the initial feature matrix, the internal cohesion measure of the post-processing feature matrix, and the expected similarity between cross-stage samples.

[0012] Preferably, the calculation formula for the expectation value of the internal kernel matrix of the initial feature matrix is:

[0013] where represents the expectation value of the internal kernel matrix of the initial feature matrix, and represent the feature vectors of two nodes in the 0th layer network, and ; ; ; represents the kernel function; The calculation formula for the internal cohesion measure of the post-processing feature matrix is:

[0014] where represents the internal cohesion measure of the post-processing feature matrix, and represent the feature vectors of two nodes in the th layer network; and ; The calculation formula for the expected similarity between cross-stage samples is:

[0015] where represents the expected similarity between cross-stage samples; The calculation formula for the MMD loss function is:

[0016] where represents the MMD loss.​

[0017] Preferably, the composite loss function is as follows:

[0018] wherein, represents the composite loss, represents the supervised label set, represents the cross-entropy loss function, represents the loss function part of the downstream task, represents the correct value, represents the predicted value, represents the learnable regularization coefficient, represents the subgraph, represents the set of subgraphs, represents calculating the MMD loss function value of the subgraph G.

[0019] The beneficial effects of the present invention are as follows: The present invention designs a structure-aware dynamic regularization framework, which balances the conflict between topology preservation and computational efficiency in the subgraph generation process through the Laplacian matrix trace constraint; constructs a differentiable community consistency evaluation module, and uses the kernel space mapping technology to realize the quantitative monitoring of the feature distribution difference. These technologies enable the present invention to achieve accurate node classification with fewer parameters when dealing with ultra-large-scale heterogeneous data such as the Open Academic Graph (OAG) and cross-platform social networks.

[0020] In a second aspect, a heterogeneous graph neural network training system based on community consistency includes: A topology-aware subgraph generation module, configured to generate a set of subgraphs of the heterogeneous graph based on community division rules; A feature drift monitoring module, configured to extract the node feature matrices of each subgraph in the set of subgraphs, perform slicing operations on each node feature matrix to obtain subgraph feature matrices aligned with the input, and design an MMD loss function; An adaptive regularization control module, configured to construct a composite loss function based on the MMD loss function, and update the parameters of the heterogeneous graph neural network through gradient reversal to complete the training of the heterogeneous graph neural network.

[0021] In a third aspect, a computer-readable storage medium stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the heterogeneous graph neural network training method based on community consistency as described in the first aspect. Description of the Drawings

[0022] Figure 1 Shown is a flowchart of a heterogeneous graph neural network training method based on community consistency.

[0023] Figure 2 The topological structure diagram of the heterogeneous graph model of the academic network in Embodiment 1 of the present invention is shown as follows.

[0024] Figure 3 The heterogeneous academic network graph constructed in Embodiment 1 of the present invention is shown as follows.

[0025] Figure 4 The community partition visualization diagram in Embodiment 1 of the present invention is shown as follows. Detailed implementation manners

[0026] The exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the embodiments shown and described in the drawings are merely exemplary, intended to illustrate the principles and spirit of the present invention, and not to limit the scope of the present invention.

[0027] Embodiment 1: As Figure 1 shown, a method for training a heterogeneous graph neural network based on community consistency includes the following steps: S1. Generate a set of subgraphs of the heterogeneous graph based on the community division rules; S2. Extract the node feature matrices of each subgraph in the subgraph set, perform slicing operations on each node feature matrix to obtain subgraph feature matrices aligned with the input, and design an MMD loss function; S3. Construct a composite loss function based on the MMD loss function, and update the parameters of the heterogeneous graph neural network through gradient reversal to complete the training of the heterogeneous graph neural network.

[0028] The heterogeneous graph neural network in the present invention is used to solve data analysis and mining of related heterogeneous graphs such as academic information heterogeneous graphs, biological information heterogeneous graphs, and network goods purchase heterogeneous graphs.

[0029] In this embodiment, the specific content of step S1 is as follows: According to the node type set of the heterogeneous graph, establish a homogeneous community division system for the node type , and its corresponding homogeneous community is , and then obtain the complete community set ; strictly defined from the perspective of set theory, the homogeneous community division needs to meet two basic conditions: the completeness condition ensures that all nodes are included in the classification system; the non - intersection condition

[0030] ensures the strict exclusivity of the category division. This division method based on type attributes effectively inherits the multi - modal characteristics of the heterogeneous graph and at the same time establishes a structural basis for subsequent subgraph analysis. Construct a set of homogeneous nodes , and then obtain the homogeneous community through two - step neighborhood expansion Set of common neighbor nodes , where represents the set of vertices in the homogeneous node set, represents the node type mapping function, represents the edges of cross-category common neighbors of the same type of nodes; Based on the set of common neighbor nodes Construct a subgraph The node set of ; Based on the set of common neighbor nodes Construct a subgraph The edge set of , where represents the homogeneous edges within the community, and there is , represents the heterogeneous edges of different types, and there is , where represents the edge type mapping function, represents the homogeneous edge, represents the heterogeneous edge; Complete the construction of the node set and edge set of all subgraphs to obtain the subgraph set .

[0031] Heterogeneous graph: A heterogeneous graph with a typed structure can be formally defined as , where the vertex set and the edge set are respectively constrained by two type mapping functions: the node type mapping function , which maps vertices to specific types in the predefined node type set ; the edge type mapping function , which maps edges to specific types in the predefined relation type set .

[0032] The heterogeneous graph model of the academic network in this embodiment is composed of three heterogeneous node types and five types of semantic association edge relations, and its topological structure is as shown in Figure 2 . Specifically, the graph structure includes: the set of academic entity nodes {A, P, F}, where A represents the author node (Author), P represents the paper node (Paper), and F represents the research field node (Field); the set of multi-edge types includes: the teacher-student guidance relationship (A - A), the author-paper attribution relationship (A - P), the academic achievement citation relationship (P - P), the research field affiliation relationship (P - F), and the field hierarchy relationship (F - F) and other five types of knowledge associations.

[0033] Homogeneous community: For node types Related structures, homogeneous communities Are formally defined as a closed set that satisfies the node membership condition, i.e., if and only if Both satisfy , where Represents the classification of node types with specific semantics in the graph structure. Such communities Essentially constitute the graph The node set composed of single-type nodes in. Further, define the homogeneous edge set of this homogeneous community in the heterogeneous graph As , and its mathematical representation can be expressed as . This edge set essentially measures the internal connection density of nodes of the same type in the topological space. The heterogeneous academic network constructed in this embodiment is as Figure 3 Shown, including three homogeneous sub-network structures: The academic entity sub-network is composed of all author nodes (A), and the connections between entities are constructed through the teacher-student guidance relationship (A-A); The academic achievement sub-network is composed of all paper nodes (P), and the semantic associations between nodes are realized through the paper citation relationship (P-P); The academic discipline sub-network integrates all research field nodes (F), and its hierarchical knowledge system is structurally represented through the field subordination relationship (F-F). It should be emphasized that the original nodes of these three homogeneous sub-networks are all completely inherited from the basic heterogeneous network, that is Figure 2 The topological structure shown, and the topological attributes of its edges maintain the structural homogeneity characteristics during the evolution process.

[0034] Common neighbors of homogeneous nodes: Let there be two node types In the sub-graph structure And non Class nodes. For nodes And , if the edge set satisfies And , then it is called For , The cross-class common neighbor node of. In the homogeneous community (where ), the cross-class common neighbors of all pairs of homogeneous nodes form a set . Further, the common neighbor set Corresponding to this community The heterogeneous edge set generated in the original graph Can be expressed as . Such as Figure 3 And Figure 4As shown in the figure, the community evolution mechanism proposed in this embodiment explains how a homogeneous community realizes the process of incorporating nodes into the community through the topological association of common neighbors. Specifically: In the construction of the author community, based on the second-order collaborative relationship of author-paper-author (A-P-A) (such as Figure 3 shown by the dashed line), paper entities (P nodes) with co-authorship relationships are incorporated into the author community; in the process of forming the paper community, through the dual mechanisms of co-authorship association of paper-author-paper (P-A-P) and thematic association of paper-field-paper (P-F-P) (such as Figure 3 shown by the dashed line), the collaborative embedding of author entities (A nodes) and disciplinary field entities (F nodes) is realized; similarly, the field community connects through the knowledge network of field-paper-field (F-P-F) (such as Figure 3 shown by the dashed line), and effectively integrates paper entities (P nodes) with common field attributes into the field community.

[0035] Subgraph of community division: For node type , by extracting all nodes and their homogeneous co-occurring neighbor node sets in its corresponding homogeneous community , a subgraph structure is constructed from the original graph , where the vertex set is composed of the union of elements within the community and neighborhood nodes , and the edge set fuses the internal edges within the community and the neighborhood interconnection edges . The set of all homogeneous subgraphs constructed by repeating this process for each node type is . As Figure 4 shown, the visualization of community partitioning presents a structured partitioning paradigm of homogeneous community subgraphs, and its core characteristics are specifically manifested as follows: The author community completely constructs a composite topological structure based on the direct cooperation network (A-A) and the second-degree collaborative network (A-P-A) through the neighborhood extension of node A, forming a knowledge collaboration map containing author nodes, paper nodes, and their associated edge sets; the paper community deeply integrates the multiple associations of the co-author network (P-A-P) and the disciplinary clustering network (P-F-P) while retaining the paper co-occurrence relationship (P-P), constructing a three-dimensional integrated network covering knowledge subjects, carriers, and classifications; the field community takes the disciplinary ontology (F-F) as the core, extends the boundary of academic resources through the field knowledge penetration path (F-P-F), and forms a dynamic mapping system of disciplinary concepts and research results. This structural feature verifies that in heterogeneous academic networks, the community partitioning mechanism based on meta-path orientation can effectively maintain the topological integrity of field knowledge.

[0036] In this embodiment, when generating a set of subgraphs of the heterogeneous graph based on the community division rule, regularization constraints are independently imposed on each subgraph to optimize the subgraph generation quality. Specifically: The spectral graph theory method is adopted, and the trace constraint of the Laplacian matrix is used to balance the cohesion and connectivity of the subgraph. Let be the normalized Laplacian matrix of the subgraph , and its regularization term is defined as , where represents the node feature matrix, represents the trace of the Laplacian matrix, represents the transpose of the matrix, represents the set of real numbers, represents the subgraph 's node set, represents the feature vector dimension.

[0037] In this embodiment, the specific step S2 is as follows: According to the subgraph node set , the original attribute features of the nodes of the heterogeneous graph are re-indexed to obtain the initial feature matrix , where represents the initial feature vector of the node , represents the transpose of the matrix, represents the set of real numbers, represents the subgraph scale, represents the feature vector dimension; The feature matrix is aligned through a predefined node type mapping function . Specifically: The node set in the community is subjected to a feature slicing operation to generate an initial feature matrix of a specific type, where represents the number of nodes, represents the node type subscript, represents the node 's initial feature vector; During the feature transfer process of the heterogeneous graph neural network, the feature matrix is iteratively updated between different layers. The output of the -th layer network is , where is the activation function, is the learnable weight, is the bias term, represents the output of the -th layer network; Perform a type projection operation on the inter-layer propagation of the heterogeneous graph neural network to extract the subgraph feature matrix of each layer , where represents all nodes with node type in layer's feature representation vector, represents the th layer of the neural network, represents the subgraph feature matrix output by the entire heterogeneous graph neural network; The type projection operation is specifically: for the feature submatrix corresponding to the community , extract the type feature of the current layer, that is, the subgraph feature matrix :

[0038] where represents the feature vector corresponding to the network node in the th layer.

[0039] In this embodiment, the designed MMD loss function is specifically: Perform multi-layer feature propagation on the initial feature matrix to obtain the post-processed feature matrix ; where represents the feature representation vector of the th node in the 0th layer network, represents the set of real numbers, represents the number of nodes, represents the dimension of the feature vector, represents the feature representation vector of the th node in the th layer network, represents the transpose of the matrix; Establish a reproducing kernel Hilbert space through the kernel function , and calculate the expected value of the internal kernel matrix of the initial feature matrix and the internal cohesion measure of the post-processed feature matrix in the reproducing kernel Hilbert space respectively. The formula for the expected value of the internal kernel matrix of the initial feature matrix is:

[0040] where represents the expected value of the internal kernel matrix of the initial feature matrix, and represent in the 0th layer network, and the feature vectors of two nodes, ,​ , represents the kernel function; The calculation formula for the internal cohesion measure of the post - processing feature matrix is:

[0041] where, represents the internal cohesion measure of the post - processing feature matrix, and represent at the layer network, and are the feature vectors of two nodes; Construct the cross - kernel matrix of the initial feature matrix and the post - processing feature matrix, and then calculate the expected similarity between cross - stage samples:

[0042] where, represents the expected similarity between cross - stage samples, which captures the correlation level between the original information and the transformed information during the feature transfer process, and the value range depends on the nature of the kernel function and the hyperparameter settings; According to the expected value of the internal kernel matrix of the initial feature matrix, the internal cohesion measure of the post - processing feature matrix, and the expected similarity between cross - stage samples, construct the MMD loss function through the squared deviation:

[0043] where, represents the MMD loss, and its geometric meaning can be interpreted as: in the reproducing kernel Hilbert space, the square of the distance between the mean vectors of two classes of distributions is equal to the sum of their respective self - similarities minus twice the mutual similarity. In the embodiments of the present invention, the radial basis function (Radial Basis Function) is used as the kernel function (Gaussian kernel), and its expression formula is:

[0044] where, represents the function of the distance between vector and vector , represents the exponential function with the natural base as the base, Denote the bandwidth parameter, which is adaptively determined by the median heuristic method, that is, taking the median of the Euclidean distances of all samples as the parameter reference value. This measurement method has three significant advantages: First, non-parametric tests can be achieved without assuming the data distribution form; Second, the similarity calculation in the high-dimensional feature space is effectively processed through the kernel trick; Third, it preserves the feature of translational invariance, avoiding the measurement deviation caused by the change of the coordinate system. At the algorithm implementation level, block matrix calculation technology is adopted to reduce the space complexity, ensuring that this method can be extended to large-scale community feature analysis scenarios.

[0045] In this embodiment, the composite loss function is as follows:

[0046] Where, Denote the composite loss, Denote the supervised label set, Denote the cross-entropy loss function, Denote the loss function part of the downstream task, Denote the correct value, Denote the predicted value, Denote the learnable regularization coefficient, Denote the subgraph, Denote the subgraph set, Denote the value of the MMD loss function of the subgraph G; This composite loss function formula realizes the balance between task-driven optimization and structure-preserving order constraint. The former ensures the performance of the model on specific downstream tasks, and the latter maintains the topological characteristics of the graph by forcing the consistency of the subgraph feature distribution.

[0047] The formula for updating the parameters of the heterogeneous graph neural network through gradient reversal is:

[0048] Where, Denote the weight matrix of the heterogeneous graph neural network, Denote assignment, Denote the partial differential parameter, Denote the partial differential symbol.

[0049] Embodiment 2: On the basis of Embodiment 1, the embodiment of the present invention conducts OGB academic graph benchmark test verification. This solution has significant advantages, and the experimental results are shown in Table 1.

[0050] Table 1 OGB academic graph benchmark test verification results

[0051] Experiments show that the present invention can significantly improve the GNN in terms of structural stability, training efficiency, and interpretability. In terms of structural stability, the feature drift amount within the community is reduced by 32.7% (p<0.01); in terms of training efficiency, the method proposed by the present invention enables the GNN to achieve a 75.3% convergence acceleration ratio on a graph with tens of millions of nodes; in terms of interpretability, t-SNE visualization shows that the method proposed by the present invention improves the clarity of the disciplinary boundary of the GNN by 2.3 times.

[0052] Embodiment 3: Based on Embodiment 1, the embodiment of the present invention provides a heterogeneous graph neural network training system based on community consistency, which is configured to execute a heterogeneous graph neural network training method based on community consistency in Embodiment 1. The system includes: A topology-aware subgraph generation module, configured to generate a set of subgraphs of the heterogeneous graph based on community partitioning rules; A feature drift monitoring module, configured to extract the node feature matrices of each subgraph in the set of subgraphs, perform slicing operations on each node feature matrix to obtain subgraph feature matrices aligned with the input, and design an MMD loss function; An adaptive regularization control module, configured to construct a composite loss function based on the MMD loss function, and update the parameters of the heterogeneous graph neural network through gradient reversal to complete the training of the heterogeneous graph neural network.

[0053] In this embodiment, an electronic device is also provided, including a memory, a processor, and a computer program stored on the memory and running on the processor. The processor executes the program to implement some or all of the steps of the heterogeneous graph neural network training method based on community consistency as described in Embodiment 1.

[0054] In this embodiment, the electronic device may include: a processor, a memory, a bus, and a communication interface. The processor, the communication interface, and the memory are connected through the bus. A computer program that can run on the processor is stored in the memory. When the processor runs the computer program, it executes some or all of the steps of the heterogeneous graph neural network training method based on community consistency provided in the foregoing Embodiment 1 of the present application.

[0055] The system in the embodiment of the present invention may also be a computer-readable storage medium storing a computer program, and when the computer program is executed, some or all of the steps of the heterogeneous graph neural network training method based on community consistency as described in Embodiment 1 are implemented.

[0056] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program codes can be executed entirely on the machine, partially on the machine, executed partially on the machine as an independent software package and partially on a remote machine, or executed entirely on a remote machine or server.

[0057] In the context of the present invention, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0058] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input received from the user can be in any form (including acoustic input, voice input, or tactile input).

[0059] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.

[0060] A computer system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs that run on the respective computers and have a client-server relationship with each other. The server can be a cloud server, a server of a distributed system, or a server incorporating blockchain.

[0061] Those of ordinary skill in the art will realize that the embodiments described herein are for helping the reader understand the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. Those of ordinary skill in the art can make various other specific deformations and combinations that do not depart from the essence of the present invention based on the technical revelations disclosed in the present invention, and these deformations and combinations are still within the scope of protection of the present invention.

Claims

1. A training method for heterogeneous graph neural network based on community consistency, characterized in that Including the following steps: Generating a set of subgraphs of the heterogeneous graph based on community partitioning rules; Extracting the node feature matrices of each subgraph in the set of subgraphs, performing slicing operations on each node feature matrix to obtain subgraph feature matrices aligned with the input, and designing an MMD loss function; Constructing a composite loss function based on the MMD loss function and updating the parameters of the heterogeneous graph neural network through gradient reversal to complete the training of the heterogeneous graph neural network.

2. The method for training a heterogeneous graph neural network based on community consistency according to claim 1, wherein, The generating of the set of subgraphs of the heterogeneous graph based on community partitioning rules is specifically: According to the heterogeneous graph 's node type set Establish a homogeneous community division system for the node type , and its corresponding homogeneous community is , and then obtain the complete community set , where represents the heterogeneous graph vertex set, represents the edge set; Construct a homogeneous node set , and then obtain a homogeneous community through two-step neighborhood expansion of the set of common neighbor nodes , where represents the vertex set in the homogeneous node set, represents the node type mapping function, represents the edge of the cross-class common neighbors of the same type of nodes; Based on the set of common neighbor nodes Construct a subgraph of the node set ; Based on the set of common neighbor nodes Construct a subgraph of the edge set , where represents the homogeneous edges within the community, and there are , represents the heterogeneous edges across types, and there are , where represents the edge type mapping function,[[]] represents the homogeneous edges,[[]] represents the heterogeneous edges; Complete the construction of the node set and edge set for all subgraphs to obtain the subgraph set .

3. The method for training a heterogeneous graph neural network based on community consistency according to claim 2, wherein When generating a set of subgraphs of the heterogeneous graph based on the community division rule, regularized constraints are independently imposed on each subgraph to optimize the quality of subgraph generation, specifically: Using the spectral graph theory method, the cohesion and connectivity of subgraphs are balanced by the trace constraint of the Laplacian matrix. Let be the normalized Laplacian matrix of the subgraph , and its regularization term is defined as , where represents the node feature matrix, represents the trace of the Laplacian matrix, and the superscript represents the transpose of the matrix, represents the set of real numbers, represents the node set of the subgraph , and represents the dimension of the eigenvector.

4. The method for training a heterogeneous graph neural network based on community consistency according to claim 2, wherein The extracting of the node feature matrices of each subgraph in the set of subgraphs and performing slicing operations on each node feature matrix to obtain subgraph feature matrices aligned with the input is specifically: According to the sub - graph node set for the nodes of the heterogeneous graph of the original attribute features perform index rearrangement, and then through a predefined node - type mapping function perform the alignment of the feature matrix. Specifically: for the node set in the community perform a feature slicing operation to generate an initial feature matrix of a specific type , where represents the number of nodes, represents the node - type subscript, represents the node of the initial feature vector; Input the initial feature matrix into the heterogeneous graph neural network, and perform iterative updates through different layers in sequence. The output of the -th layer of the heterogeneous graph neural network is , where is the activation function, is the learnable weight, is the bias term, represents the output of the -th layer of the heterogeneous graph neural network. When takes the value of 1, the output of the 0-th layer of the heterogeneous graph neural network is . represents the set of real numbers, represents the dimension of the feature vector; Perform a type projection operation on the inter-layer propagation of the heterogeneous graph neural network to extract the subgraph feature matrix of the layer network of the heterogeneous graph neural network .

5. The method for training a heterogeneous graph neural network based on community consistency according to claim 4, wherein The type of projection operation is specifically as follows: for the community corresponding feature sub-matrix , the subgraph feature matrix of the current layer is extracted through the type filtering operator : : Among them, represents the layer network node corresponding eigenvector.

6. The method for training a heterogeneous graph neural network based on community consistency according to claim 4, wherein The designing of the MMD loss function is specifically: Through a kernel function A reproducing kernel Hilbert space is established, and the expected value of the internal kernel matrix and the internal coherence measure of the post-processed feature matrix of the initial feature matrix are respectively calculated within the reproducing kernel Hilbert space; the post-processed feature matrix is ; Construct an initial feature matrix and a post - processed feature matrix of the cross - kernel matrix, and then calculate the expected similarity between cross - stage samples; Constructing the MMD loss function through the squared deviation according to the expected value of the internal kernel matrix of the initial feature matrix, the internal cohesion measure of the post-processed feature matrix, and the expected similarity between cross-stage samples.

7. The method for training a heterogeneous graph neural network based on community consistency according to claim 6, wherein The calculation formula for the expected value of the internal kernel matrix of the initial feature matrix is: Among them, represents the expected value of the internal kernel matrix of the initial feature matrix, and represent the feature vectors of two nodes in the 0th layer network, and , , represent the kernel function;​ The calculation formula for the internal cohesion measure of the post-processed feature matrix is: Among them, represents the internal cohesion measure of the post - processing feature matrix, and represents at the layer network, and the feature vectors of two nodes; The calculation formula for the expected similarity between cross-stage samples is: Among them, represents the expected similarity between cross-stage samples; The calculation formula for the MMD loss function is: Among them, represents the MMD loss.

8. The method for training a heterogeneous graph neural network based on community consistency according to claim 1, wherein The composite loss function is: Among them, represents the composite loss, represents the supervised label set, represents the cross-entropy loss function, represents the loss function part of the downstream task, represents the correct value, represents the predicted value, represents the learnable regularization coefficient, represents the subgraph, represents the set of subgraphs, represents the value of the MMD loss function for the subgraph G.

9. A heterogeneous graph neural network training system based on community consistency, characterized in that, Including: A topology-aware subgraph generation module for generating a set of subgraphs of the heterogeneous graph based on community partitioning rules; A feature drift monitoring module for extracting the node feature matrices of each subgraph in the set of subgraphs, performing slicing operations on each node feature matrix to obtain subgraph feature matrices aligned with the input, and designing an MMD loss function; An adaptive regularization control module for constructing a composite loss function based on the MMD loss function and updating the parameters of the heterogeneous graph neural network through gradient reversal to complete the training of the heterogeneous graph neural network.

10. A computer-readable storage medium, characterized in that, The storage medium stores computer instructions. After the computer reads the computer instructions in the storage medium, the computer executes the method for training a heterogeneous graph neural network based on community consistency according to any one of claims 1-8.

Citation Information

Patent Citations

  • A graph neural network representation learning-based structure graph alignment method and a multi-graph joint data mining method

    CN113255895A

  • Node classification method based on heterogeneous information network few-sample learning

    CN114239711A

  • Non-supervision community detection method and device based on heterogeneous network, equipment and medium

    CN117390470A

  • Graph neural network training methods and systems

    US11227190B1