Heterogeneous network community discovery method fusing multi-attention mechanism and embedded learning

By integrating multi-attention mechanisms and embedded learning, the heterogeneous network community discovery method is solved, and high-quality community discovery and efficiency improvement are achieved.

CN119150048AInactive Publication Date: 2024-12-17CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411135487.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When existing technologies are discovered in social networks, they rely solely on topological structures, making it difficult to accurately divide high-quality communities, and graph learning technology has the limitation of dividing nodes into communities that do not belong to their own communities.

Method used

Using a heterogeneous network community discovery method that integrates multi-attention mechanism and embedded learning, the node's neighbor feature information and its own feature information are obtained by constructing a heterogeneous network graph, and using structural aggregator and semantic content encoder to learn, output node embedding Matrix, used for community division.

Benefits of technology

It improves the accuracy and stability of community division, can better use network information for accurate community division, and improves computing efficiency and community discovery efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150048A_ABST
    Figure CN119150048A_ABST
Patent Text Reader

Abstract

The invention discloses a heterogeneous network community discovery method integrating a multi-attention mechanism and embedded learning, which comprises the following steps of: constructing a heterogeneous network graph, and converting node attributes; obtaining a network sub-graph; obtaining a structure matrix C in a structure aggregation encoder by using an attention mechanism; acquiring a feature matrix X in a semantic content encoder by using a multi-layer attention mechanism; taking the structure matrix and the feature matrix as input of a convolutional network, and outputting an embedded matrix Z of the nodes; and the embedded matrix Z is used for downstream tasks, and learning training is carried out by constructing a loss function for community discovery of a social network. According to the method, the advantages of the graph learning technology are fully played, the community discovery problem is solved by using the convolutional network, and inductive learning expression can be performed while community discovery is performed on a large-scale network, so that the calculation efficiency can be improved, and high-quality community division can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network science, and in particular relates to a heterogeneous network community discovery method integrating multi-attention mechanism and embedded learning. Background Art

[0002] In recent years, with the rapid development of the Internet and technology, the scale and number of social networks are also expanding and growing. The current network data information is displayed in a diversified way. Taking social networks as an example, communication platforms such as Instagram, Twitter, WeChat, Weibo, and Zhihu are developing rapidly. The user scale of the platforms is increasing with their development, which also makes the network more and more complex and the information more diversified. These social networks reflect the social relations in the real world. In our real life, there are some groups with the same interests, so social networks have the characteristics of community structure. Different social networks have different community structures. Then the community structure is a special subgraph. It is composed of some similar interconnected vertices, and it is ensured that the connection density between nodes within the same community is higher than the connection density between different communities, that is, the connection within the group is close and the connection between groups is sparse. For example, on the Weibo social platform, the community represents a group that pays attention to the same celebrity; in the Zhihu network, the community represents a group that pays attention to the same hot topic. The process of analyzing the existence of these communities in social networks is called community discovery.

[0003] Community discovery in social networks can not only show the modular grouping in social networks, but also help people analyze the functions of the network and the meaning it represents, discover some hidden information and potential laws in the social network, and predict the changes and development of the network to guide people to solve some real-life problems. When community discovery is used as a technology, we can apply it to predicting close contacts infected with the new coronavirus, fraud prediction, interest recommendation, etc. Therefore, community discovery has high application value and practical significance.

[0004] Regarding finding potential communities in a network through community discovery, many community discovery algorithms have been proposed in the prior art, such as the GN algorithm based on graph partitioning, the FN algorithm based on modularity optimization, the Infomap algorithm based on random walks, the heuristic-based algorithm, etc. However, these methods only use topological structures to divide communities, which has certain limitations in accurately dividing high-quality communities.

[0005] In recent years, with the development of graph learning technology, given the high efficiency of deep learning technology in solving problems, combining graph learning with community discovery for community segmentation has become a hot development trend in the field of network analysis. In the past, graph learning technology still only used the graph topology of the network to solve problems, but the structure and information content of social networks are very complex and changeable, which makes many nodes be divided into communities that do not belong to them. Therefore, traditional graph learning technology has certain limitations in solving community discovery problems. Summary of the invention

[0006] Based on the above shortcomings of the prior art, the present invention proposes a heterogeneous network community discovery method that integrates multi-attention mechanism and embedded learning, gives full play to the advantages of graph learning, combines the multi-attention mechanism network topology structure to fuse the node's neighbor feature information and its own feature information to divide the community, and uses the information in the heterogeneous network graph to obtain more accurate community division results.

[0007] The technical solution of the present invention is: a heterogeneous network community discovery method integrating multi-attention mechanism and embedded learning, comprising the following steps:

[0008] Based on the data of social networks, a heterogeneous network graph is constructed and the attributes of the nodes in the graph are transformed;

[0009] Based on the nodes after attribute conversion and the meta-paths in the heterogeneous network graph, the network subgraph is obtained through the subgraph sampler;

[0010] Based on the structural information of the subgraph, the attention mechanism is used to aggregate the structural information between nodes in the structural aggregation encoder to obtain the embedding of the node in the subgraph and obtain the structural matrix C.

[0011] Based on the semantic features of nodes and meta-paths in the subgraph, a multi-layer attention mechanism is used to learn the feature information of the nodes themselves in the semantic content encoder to obtain the feature matrix X;

[0012] Using the structure matrix C and the feature matrix X as inputs of the convolutional network, and outputting the embedding matrix Z of the node;

[0013] The embedding matrix Z is used for downstream tasks and is trained by constructing a loss function for community discovery in social networks.

[0014] Preferably, the node attributes in the conversion graph model are specifically mapped to the same potential feature vector space by mapping different types of node feature vectors to each type of node feature vector, and linearly transforming each type of node feature vector. For a node v∈V of type a∈A, a , then:

[0015]

[0016] in, is the original feature vector of node v of type a, h′ v is the feature vector of node v after mapping, W a is a parameterized weight matrix of type a.

[0017] 3. According to claim 1, the heterogeneous network community discovery method integrating multi-attention mechanism and embedded learning is characterized in that: the meta-path includes isomorphic meta-path and heterogeneous meta-path; the sub-graph includes isomorphic sub-graph and heterogeneous sub-graph.

[0018] Preferably, the attention mechanism is a multi-head attention mechanism, which obtains the attention vector of the target node based on the importance of neighbor nodes. The calculation formula is as follows:

[0019]

[0020] Among them, K is the number of attention mechanism heads, k is the counting parameter of the number of attention mechanism heads, are all neighbors connected to the target node v in the subgraph G′, σ(·) is the activation function, is the weight coefficient, h′ u is the feature vector of node u after attribute conversion.

[0021] Preferably, the structure matrix C is calculated as follows:

[0022]

[0023] in, is the weight coefficient of different subgraphs, i is the subgraph counting parameter, |g′ a | indicates the total number of subgraphs, is the structure matrix of the target node v in different subgraphs.

[0024] Preferably, the semantic content encoder includes a deep neural network for implementing node attention and a deep neural network for implementing semantic attention, and the multi-layer attention mechanism is a double-layer attention mechanism.

[0025] 7. The heterogeneous network community discovery method integrating multi-attention mechanism and embedded learning according to claim 1 is characterized in that: the feature matrix X is calculated by the following formula:

[0026]

[0027] in, are the attention weights of different meta-paths, is the attention vector of different meta-paths, m is the total number of meta-paths, and j is the counting parameter of the meta-path.

[0028] Preferably, the convolutional network is a double-layer convolutional network.

[0029] Preferably, the layered propagation rule of the convolutional network is calculated as follows:

[0030] H (l+1) =ReLU(CH (l) W (l) )

[0031] Among them, H (l+1) represents the output of the (l+1)th layer, H (l) represents the output of the (l)th layer, W (l) represents the trainable weight matrix of a specific layer, ReLU(·) represents the activation function, and C is the structure matrix; when l = 0, H (0) =X, X is the feature matrix;

[0032] According to the hierarchical propagation rule, we get the node embedding matrix Z = H (l+1) .

[0033] Preferably, the downstream tasks include semi-supervised learning and unsupervised learning; the semi-supervised learning constructs a semi-supervised loss function to train and optimize node parameters and classify the nodes; the unsupervised learning constructs an unsupervised loss function to train and optimize the weights of the convolutional network model, clusters the nodes and predicts links to achieve community division.

[0034] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention constructs a heterogeneous network graph based on the data of the social network; obtains the network subgraph through the subgraph collector; uses the attention mechanism to learn the feature information of the neighbor nodes and the feature information of the node itself by the structure aggregation encoder and the semantic content encoder respectively, obtains the structure matrix and the feature matrix and inputs them into the convolutional network, outputs the embedding matrix of the node, and uses the embedding matrix for downstream tasks, and performs learning and training through the loss function to realize the community discovery of the social network. The present invention gives full play to the advantages of graph learning technology, uses the convolutional network to solve the community discovery problem, and can perform inductive learning expression while performing community discovery on a large-scale network, which can not only improve the computational efficiency, but also obtain high-quality community division. The present invention integrates the topological structure of the network, the node feature information and the feature information of its neighbor nodes, so that the node features can be learned and expressed with higher quality, can better use the information in the network to divide accurate communities, and improve the efficiency of community discovery, and the present invention can be applied to large-scale social network data, which can improve the accuracy and stability of community division in social networks. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings of the embodiment are briefly introduced below.

[0036] Figure 1 A schematic diagram of a sub-graph sampler in the present invention acquiring a sub-graph.

[0037] Figure 2 Schematic diagram of the division of isomorphic subgraphs and heterogeneous subgraphs in the present invention.

[0038] Figure 3 It is a schematic diagram of the operation process of the present invention.

[0039] Figure 4 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0040] The following is a detailed description of the specific implementation of the present invention in conjunction with the accompanying drawings, which is a part of this specification and illustrates the principles of the present invention through examples. Other aspects, features and advantages of the present invention will become clear from the detailed description. In the drawings referred to, the same or similar parts in different figures are represented by the same reference numerals.

[0041] like Figures 1 to 4 As shown, the present invention discloses a heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning, comprising the following steps:

[0042] According to the data given by the social network, a heterogeneous network graph G(V,E) is constructed. Usually, a member in the social network represents a node, V represents the node, and the node set V = {V1, ..., V n}, n represents the number of nodes; if two members are connected to each other, it means that there is an edge between the two nodes, and E represents the edge between the nodes. The set of edges E = {E1, ..., E n}.

[0043] In this embodiment, the attributes of different types of nodes are mapped to the same latent space, so as to realize the transfer of attribute information between nodes. In the heterogeneous network graph G, different types of nodes are associated with their different attributes. For example, the n1-dimensional bag-of-words vector of the text and the n2-dimensional intensity histogram vector of the image cannot be processed uniformly even if n1=n2. Since feature vectors of different dimensions are more cumbersome to process in a unified framework, in order to facilitate unified processing, it is necessary to map different types of node feature vectors to the same latent feature vector space and apply a specific type of linear transformation to each type of node feature vector.

[0044] For a node v∈V of type a∈A a , then:

[0045]

[0046] in, is the original feature vector of node v of type a, h′ v is the feature vector of node v after mapping, W a is a parameterized weight matrix of type a. The initial value of the weight matrix is ​​randomly generated from 0 and 1, corresponding to a layer in the network. Each row represents an input feature, and each column represents the weight of the feature in the corresponding layer. For example:

[0047]

[0048] By converting node attributes, the heterogeneity problem between different types of nodes is solved, which facilitates information transmission and aggregation between nodes in the heterogeneous network graph G.

[0049] For a heterogeneous network graph G(V,E), the smallest subgraph of the heterogeneous network contains all node types in the heterogeneous network graph G. However, in a multimodal heterogeneous network, the number of neighbor nodes connected to the target node varies depending on the node type, which may lead to an unbalanced distribution and affect data analysis, mining, and learning tasks in the heterogeneous network. In order to solve this problem and prevent the advantages of a large number of nodes from masking the influence of other neighbor nodes, such as Figure 1 As shown, in this embodiment, a subgraph sampler is used to select a subset of heterogeneous neighbor nodes connected to the target node, and the number of sampled neighbor nodes is determined by the number of nodes in the heterogeneous network graph. Finally, the subgraph sampler returns a network subgraph containing the target node.

[0050] About target nodes: In heterogeneous networks, there are many types of nodes, but usually only one type of node is dominant, which is the target node (also called: master node); other nodes are slave nodes, acting as bridges to the target node. The target node is the object of community detection, and the slave node provides heterogeneous information to supplement the structure and semantics of the target node. For example, in the DBLP dataset, Author is identified as the target node, which plays a dominant role, while Paper and Venue are slave nodes.

[0051] About the neighbors of the meta-path: Given a target node v and a meta-path P in a heterogeneous network graph G, based on the neighbors of the meta-path P is the set of nodes connected to the target node v through the meta-path P. If the meta-path P is symmetric, then the neighbors of the meta-path P are Contains the target node v itself.

[0052] Different meta-paths represent different semantics. According to the starting node and ending node types of the meta-path, the meta-path can be divided into homogeneous meta-paths and heterogeneous meta-paths. For example, in the DBLP dataset, if there is a meta-path of paper-author-paper (PAP), since the starting node and the ending node of the meta-path are both Paper (P), they belong to the same category, so the meta-path is a homogeneous meta-path; if there is a meta-path of paper-conference (PV), since the starting node of the meta-path is Paper (P) and the ending node is Venue (V), they belong to different types, so the meta-path is a heterogeneous meta-path, and the expression is as follows:

[0053] P=P t ,t∈{ho,he}

[0054] Among them, t is the type of meta-path, ho means that the starting node and the ending node in the meta-path are of the same type, and he means that the starting node and the ending node in the meta-path are of different types.

[0055] like Figure 2 As shown in Figure 1, given a meta-path of a heterogeneous network graph G, a subgraph based on the meta-path is a graph constructed by all neighbor pairs based on the meta-path in the heterogeneous network graph G. If the meta-path starts and ends with nodes of the same type, it is a homogeneous subgraph. If the meta-path starts and ends with nodes of different types, it is a heterogeneous subgraph. In order to fully understand the information of each meta-path, an aggregation method is applied to each subgraph. According to the type t of the meta-path, the generated subgraph G t , the subgraph G t Divide into isomorphic subgraphs G ho and heterogeneous subgraph G he , the expression is as follows:

[0056] G t =G ho ∪G he

[0057] For a specific type of node, its connection with neighboring nodes in different subgraphs carries different semantic information. Therefore, each subgraph can be regarded as an interaction graph with specific semantic information. Since the subgraphs are independent, the learning task can be performed in parallel on each subgraph, thereby improving the learning efficiency of the model. By learning from homogeneous subgraphs and heterogeneous subgraphs separately, as much useful information as possible can be retained.

[0058] The node self-attention mechanism is an effective information aggregator. Since different neighbors may have different influences on the target node, it is necessary to learn the importance of each neighbor through attention, and then use the node self-attention mechanism to aggregate information from homogeneous subgraphs and heterogeneous subgraphs.

[0059] In the structured aggregation encoder, for the target node v∈Va In the sub-graph A node pair (v,u) in which the node pair (v,u) is a meta-path starting with node type a∈A Generate, use the graph attention layer to learn to measure the importance of node u Describes the importance of the contribution of node u to the target node v in homogeneous subgraphs and heterogeneous subgraphs.

[0060] The importance of node u in the isomorphic subgraph The calculation formula is as follows:

[0061]

[0062] in, Represents the node parameterized attention vector of subgraph G′ in type a, which is used to calculate the attention weights between nodes to determine which neighbor information is more important to the current node, h′ v is the feature vector of the mapped target node v, || represents the connection operation, h′ u is the feature vector of node u after attribute conversion.

[0063] In a heterogeneous subgraph, the importance of node u The calculation formula is as follows:

[0064]

[0065] Generic node based Importance of contribution to target node v Normalize the weight coefficient using the softmax function The calculation formula is as follows:

[0066]

[0067] in, are all neighbors connected to the target node v in the subgraph G′, s are the neighbor nodes of the target node v in the subgraph G′, Representation Node The importance of the target node v, For Node Importance to the target node v.

[0068] Aggregate the feature vectors mapped by all neighbor nodes in the subgraph G′ and learn the embedded representation of the target node v in the subgraph G′ The calculation formula is as follows:

[0069]

[0070] Among them, σ(·) is the activation function, is the weight coefficient, which describes the normalization process to ensure that all weights are within a certain range, which helps prevent certain features from having too much impact on the model output, thereby improving the stability and generalization ability of the model. are all neighbors connected to the target node v in the subgraph G′.

[0071] In order to reduce the variance caused by the heterogeneity of heterogeneous network graphs and make the learning process more stable, in this embodiment, the self-attention mechanism is extended to multiple heads, that is, the multi-head attention mechanism. Specifically, multiple independent attention mechanisms are repeated, and the learned multiple embedding representations are connected to obtain the attention vector of the target node v The calculation is as follows:

[0072]

[0073] Where || represents the connection operation, K is the number of attention mechanism heads, k is the counting parameter of the number of attention mechanism heads, σ(·) is the activation function, is the weight coefficient, h′ u is the feature vector of node u after attribute conversion.

[0074] like Figure 3 As shown in the figure, based on the isomorphic subgraphs and heterogeneous subgraphs obtained by multiple meta-paths, each subgraph contains specific structural information. The multi-head self-attention mechanism is used to perform structural aggregation between nodes of the same type and between nodes of different types on each subgraph in the structural aggregation encoder, learn the heterogeneous structural information of the network, obtain the embedding of each node in different subgraphs, and obtain the structural matrix C.

[0075] In order to obtain more structural information, in this embodiment, the node self-attention mechanism is used to assign different attention weights to the importance of different subgraphs. Specifically, different subgraphs include isomorphic subgraphs and heterogeneous subgraphs. All target nodes v∈V are aggregated based on the multi-head self-attention mechanism. a Attention vectors in different subgraphs, |H a | represents the number of nodes, performs nonlinear transformation, average and summation on the attention vector, and calculates different subgraphs G i ′’s attention weight The calculation formula is as follows:

[0076]

[0077] in, is the parameterized attention vector of node type a, M a is the weight coefficient of node type a, b a is the bias vector of node type a, For all target nodes v∈Va In different subgraphs G i ′ is the attention vector, i is the sub-graph count parameter.

[0078] In order to make it easier to compare different sub-graphs, the softmax function is used to normalize the attention weights of different sub-graphs to obtain the weight coefficients of different sub-graphs. The calculation formula is as follows:

[0079]

[0080] Where d represents the counting parameter of subgraph type a, |g′ a | indicates the total number of subgraphs, Indicates the weight of the subgraph type a.

[0081] For different subgraphs G i ′∈G′ a Perform weighted summation to obtain all target nodes v∈V a The structural matrix C in a heterogeneous network is calculated as follows:

[0082]

[0083] Among them, |g′ a | represents the total number of subgraphs, i is the subgraph counting parameter, is the weight coefficient of different subgraphs, is the structural matrix of the target node v in different subgraphs. It is a symmetric matrix. The elements on the diagonal are 1 (because each node pays attention to itself). The off-diagonal elements represent the attention weights between nodes. The weight values ​​are usually between 0 and 1. The larger the value, the more important the relationship between the nodes. For example:

[0084]

[0085] In heterogeneous networks, the feature dimensions of different types of nodes are mostly different, and it is necessary to perform attribute conversion on the feature dimensions of different types of nodes to map different types of nodes to the same dimensional space. After the node attribute conversion, due to the different importance of different nodes in the same semantic graph and different semantic graphs, in order to measure the contribution of different subgraphs to the semantic feature representation of heterogeneous networks, in this embodiment, a double-layer attention mechanism is used to learn the importance of high-order neighbor nodes based on meta-paths in the semantic content encoder, determine the node information importance of the semantic graph and the important feature information of the node itself, and obtain the feature matrix X of the node.

[0086] In the semantic content encoder, for the target node v∈V a , subgraph A node pair (v,u) in which a meta-path starts with a node type a∈A Generate, the importance of node u to the target node v The formula is as follows:

[0087]

[0088] Among them, att node To implement a deep neural network with node attention, h′ v is the feature vector of the mapped target node v, h′ u The attribute conversion value of the target node u.

[0089] Since the connection patterns of node pairs under the same meta-path are similar, the nodes of a given meta-path can share the parameters of the deep neural network that the node pays attention to. The attention weights between adjacent node pairs (v,u) of the meta-path depend on the characteristics of the starting and ending nodes of the meta-path, and also reflect the different influence weights between adjacent nodes of the meta-path, and can maintain the inherent asymmetry of heterogeneous network graphs.

[0090] In this embodiment, node attention considers the attention weights between neighbor nodes connected to the target node in the subgraph G′, and Calculate the target node v and node The attention weight between The attention weight is the importance of node u to the target node v. The multi-head self-attention mechanism is then used to learn the embedded representation result of the target node.

[0091] Given a set of meta-paths of type t, m is the total number of meta-paths. We perform node attention on the node features and meta-paths in the heterogeneous network graph G and learn to obtain m groups of target node representations with specific semantic structures, namely, the attention vectors of the meta-paths, denoted as

[0092] The semantic information encoder represents the target node As the input of the next layer, the weights of different meta-paths are learned through semantic attention. The formula is as follows:

[0093]

[0094] Among them, att semantic Deep neural networks for semantic attention.

[0095] It can be seen that semantic attention distinguishes the differences between different types of semantic structural information in multimodal heterogeneous networks and assigns appropriate weights to meta-paths.

[0096] Semantic attention is achieved through a multi-layer perceptron (MLP), which has a three-layer structure including an input layer, a hidden layer, and an output layer. The target node representation is mapped to a shared feature space, and the similarity between the mapped target node representation and the existing semantic attention vector determines the importance of the meta-path.

[0097] Fusion of the importance of all nodes to obtain the importance of different meta-paths The calculation formula is as follows:

[0098]

[0099] In the formula, q T is the parameterized attention vector of the node, M is the weight coefficient of the meta-path, b is the offset vector of the meta-path, For the target node v in the meta path The attention vector, |H a | indicates the number of nodes.

[0100] The learning parameters of the meta-path weights in semantic attention are shared. The importance of different meta-paths is normalized using the softmax function to obtain the attention weights of different meta-paths. That is, the contribution of the meta-path to a given task, calculated as follows:

[0101]

[0102] in, are the weights of different meta-paths, is the weight of the j-th meta-path P.

[0103] It can be seen that the attention weight The larger the value of , the more important the contribution of the meta-path to the given task; conversely, the attention weight The smaller the value of , the less important the meta-path's contribution to the given task.

[0104] The node representations of different semantic structure information are weighted and fused to obtain the feature matrix X of the nodes in the complete heterogeneous network graph. The calculation formula is as follows:

[0105]

[0106] in, are the attention weights of different meta-paths, is the attention vector of different meta-paths, m is the total number of meta-paths, and j is the counting parameter of the meta-path.

[0107] The structure matrix c obtained by the structure aggregation encoder and the feature matrix X obtained by the semantic content encoder are used as the input of the two-layer convolutional network to implement the convolution operation on the heterogeneous network and output the node embedding matrix Z of the node.

[0108] In this embodiment, according to ReLU(·)=max(0,·), the hierarchical propagation rule of the double-layer convolutional network is obtained, and the calculation formula is as follows:

[0109] H (l+1) =ReLU(CH (l) W (l) )

[0110]

[0111] Among them, H (l+1) represents the output of the (l+1)th layer, H (l) represents the output of the (l)th layer, C is the structure matrix obtained in the structure aggregation encoder, and W (l) Represents the trainable weight matrix of a specific layer, belonging to the hidden layer matrix, w 11 represents the weight connecting the first neuron in the input layer and the first neuron in the hidden layer, w 1n′ represents the weight connecting the first neuron in the input layer and the n′th neuron in the hidden layer, w m′1 represents the weight connecting the m′th neuron in the input layer and the first neuron in the hidden layer, w m′n′ w m′1 represents the weight connecting the m′th neuron in the input layer and the n′th neuron in the hidden layer, m′ is the neuron number in the hidden layer, n′ is the neuron number in the input layer, and ReLU(·) represents the activation function; when l = 0, H (0) =X, where X is the feature matrix obtained in the semantic content encoder.

[0112] Thus, we get a node embedding matrix Z = H (l+1) .

[0113] The node embedding matrix is ​​used for downstream tasks, which include semi-supervised learning and unsupervised learning. A loss function corresponding to the downstream task is constructed to classify, aggregate and predict links of nodes in a heterogeneous network graph, realize community discovery in social networks, and improve the accuracy of community division.

[0114] The semi-supervised learning is specifically that only a few nodes in the heterogeneous network graph have label information, which can minimize the cross entropy of the labeled node data, and use back propagation and gradient descent methods to optimize the parameters of all nodes to obtain the node classification.

[0115] The calculation formula of the semi-supervised loss function L is as follows:

[0116]

[0117] Among them, V L is the set of labeled nodes, y v is the true value of the target node v, y′ v is the predicted probability vector of the target node v;

[0118] The unsupervised learning is specifically that the label information of nodes in the heterogeneous network is invisible, and the weights of the convolutional network model are optimized by minimizing the reconstruction loss function through negative sampling, and the nodes are clustered and the links are predicted to achieve community division.

[0119] The calculation formula of the unsupervised loss function Q is as follows:

[0120]

[0121] Among them, (v,u) is an original pair of nodes, u′ is the node after the attribute of node u is converted, is the transpose of the original attribute target node v, h u is the value of the original attribute node u, is the transpose of the original attribute target node v of the negative sample, h u′ is the value of node u′, g(·) is the sigmoid activation function, V + is the set of connected (positive) node pairs, V - is the set of negative node pairs randomly selected from all unconnected node pairs.

[0122] The present invention constructs a member relationship network based on the data of the social network, and then obtains all subgraphs in the heterogeneous network through a subgraph sampler. The structural encoder and the semantic encoder continuously aggregate the structural information and semantic information of the nodes, and use the aggregated neighbor information and its own features as the input of the graph convolutional network, output the node embedding matrix, and then perform node classification, node clustering and link prediction on the heterogeneous network by constructing a loss function, and finally obtain the result of community division.

[0123] The parts not involved in the present invention are the same as the prior art or are implemented by using the prior art.

[0124] The above contents are further detailed descriptions of the present invention in combination with specific implementation methods, 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 of the present invention, 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 scope of protection of the present invention.

Claims

1. A heterogeneous network community discovery method that integrates multi-attention mechanism and embedding learning, characterized by: The steps include: Based on the data of social networks, a heterogeneous network graph is constructed and the attributes of the nodes in the graph are transformed; Based on the nodes after attribute conversion and the meta-paths in the heterogeneous network graph, the network subgraph is obtained through the subgraph sampler; Based on the structural information of the subgraph, the attention mechanism is used to aggregate the structural information between nodes in the structural aggregation encoder to obtain the embedding of the node in the subgraph and obtain the structural matrix C. Based on the semantic features of nodes and meta-paths in the subgraph, a multi-layer attention mechanism is used to learn the feature information of the nodes themselves in the semantic content encoder to obtain the feature matrix X; Using the structure matrix C and the feature matrix X as inputs of the convolutional network, and outputting the embedding matrix Z of the node; The embedding matrix Z is used for downstream tasks and is trained by constructing a loss function for community discovery in social networks.

2. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The node attributes in the conversion graph model are specifically mapped to the same potential feature vector space by mapping different types of node feature vectors to each type of node feature vector, and linearly transforming each type of node feature vector. a , then: in, is the original feature vector of node v of type a, h ′ v is the feature vector of node v after mapping, W a is a parameterized weight matrix of type a.

3. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The meta-path includes a homogeneous meta-path and a heterogeneous meta-path; the sub-graph includes a homogeneous sub-graph and a heterogeneous sub-graph.

4. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The attention mechanism is a multi-head attention mechanism, which obtains the attention vector of the target node based on the importance of neighbor nodes. The calculation formula is as follows: Among them, K is the number of attention mechanism heads, k is the counting parameter of the number of attention mechanism heads, is the subgraph G ′ All neighbors connected to the target node v in , σ(·) is the activation function, is the weight coefficient, h ′ u is the feature vector of node u after attribute conversion.

5. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The structural matrix C is calculated as follows: in, is the weight coefficient of different subgraphs, i is the subgraph count parameter, |g ′ a | indicates the total number of subgraphs, is the structure matrix of the target node v in different subgraphs.

6. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The semantic content encoder includes a deep neural network for implementing node attention and a deep neural network for implementing semantic attention, and the multi-layer attention mechanism is a double-layer attention mechanism.

7. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The characteristic matrix X is calculated as follows: in, are the attention weights of different meta-paths, is the attention vector of different meta-paths, m is the total number of meta-paths, and j is the counting parameter of the meta-path.

8. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The convolutional network is a double-layer convolutional network.

9. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The layered propagation rule of the convolutional network is calculated as follows: H (l+1) =ReLU(CH (l) IN (l) ) Among them, H (l+1) represents the output of the (l+1)th layer, H (l) represents the output of the (l)th layer, W (l) represents the trainable weight matrix of a specific layer, ReLU(·) represents the activation function, and C is the structure matrix; when l = 0, H (0) =X, X is the feature matrix; According to the hierarchical propagation rule, we get the node embedding matrix Z = H (l+1) .

10. The heterogeneous network community discovery method integrating multi-attention mechanism and embedding learning according to claim 1, characterized in that: The downstream tasks include semi-supervised learning and unsupervised learning; the semi-supervised learning constructs a semi-supervised loss function to train and optimize node parameters and classify the nodes; the unsupervised learning constructs an unsupervised loss function to train and optimize the weights of the convolutional network model, clusters the nodes and predicts the links to achieve community division.

Citation Information

Cited By

  • Financial heterogeneous network community discovery method combining comparative learning and generative learning based on matching rate

    CN119863300A

  • Electronic load circuit fault diagnosis method based on multi-channel graph attention network

    CN119989240A

  • Link prediction method and system based on GNN and Transform

    CN120561345A

  • User behavior-driven personalized teaching method and device, equipment and medium

    CN122312303A