Self-supervised community detection algorithm-SSGCNCD based on graph convolutional network
By using self-supervised learning and graph convolutional networks in the community detection algorithm, redefining the node attribute matrix as a membership matrix and combining it with core node information solves the problems of information loss and insufficient combination in community detection in the existing technology, and achieves End-to-end community detection and accurate community structure identification.
Patent Information
- Application Number
- CN202410753075.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-10-01
AI Technical Summary
Existing community detection algorithms have problems with node information loss and insufficient combination when dealing with complex networks. Especially in the absence of node attribute characteristics and supervision information, it is difficult to accurately detect community structures.
A self-supervised community detection algorithm SSGCNCD based on graph convolution network is proposed. By redefining the node attribute feature matrix as the node's membership matrix to the community, self-supervised learning and core nodes are used as semi-supervised information to train the GCN model to learn nodes. The affiliation relationship realizes end-to-end community detection and optimizes the community structure through k-means clustering.
It realizes automatic detection of community structure without pre-specifying the number of communities and node labels, avoids the problems of node information loss and insufficient combination, and improves the accuracy and efficiency of community detection.
Smart Images

Figure CN118734896A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of community detection in complex network analysis, and specifically relates to a self-supervised community detection method based on graph convolutional network, Self-Supervised Community Detection based on GCN, marked as SSGCNCD method. Background Art
[0002] In recent years, due to the rapid development of emerging technologies such as the Internet, social media and big data, complex network analysis has attracted widespread attention from researchers and has made significant progress. The research field of complex network analysis involves many directions, such as community detection [1]-[3] , node clustering [4][5] , Link Prediction [6][7] , Node importance assessment [8][9] , anomaly detection, etc.
[10]
[11] These studies reveal and predict the functional characteristics and operating mechanisms of the corresponding actual systems through the study of network structure and behavior, providing theoretical and methodological support for solving practical problems. At the same time, these tasks are also interrelated and jointly promote the development of the ability to understand and analyze complex networks. Among them, the study of community detection is to divide the nodes in the network into groups with dense internal connections but relatively sparse external connections through algorithms. Each group is a community. Figure 1 An example of community structure is given. Community structure is very common in real-world networks, such as friend circles in social networks, groups of scientists in scientist collaboration networks, etc. Community detection is the process of discovering community structure in a network. Detecting community structure can better understand the organizational structure and functional partitioning in the network.
[0003] In recent years, with the rapid development of big data technology, complex networks have also shown the characteristics of highly complex structures and dynamic changes, and traditional algorithms and graph data processing tools are difficult to accurately model them. Graph Neural Networks (GNN), such as Graph AutoEncoder (GAE), Variational AutoEncoder (VGAE), Graph Convolution Networks (GCN) and Graph Attention Networks (GAT) and other GNN models, can better handle the nonlinear relationships and high-dimensional data of the network, and provide more accurate and comprehensive network analysis results. Therefore, GNN is widely used in complex network analysis. GNN also has powerful modeling capabilities. It can learn the representation of nodes by coupling the topological structure and attribute characteristics of nodes, and analyze and predict through information transmission and update. Not only that, GNN can also adapt to various types of complex networks, including social networks, biological networks, transportation networks, financial networks, etc. It does not rely on prior knowledge of a specific network type, but analyzes and predicts by learning the structural features and attribute features in the network, which makes GNN have a wide range of applications and adaptability, and can be used for complex network analysis tasks in various fields. In addition, traditional complex network analysis methods face the problems of high computational complexity and low efficiency when dealing with large-scale networks, while GNN has good scalability and can reduce computational complexity and improve computational efficiency through parallel computing and sampling methods, which enables GNN to handle large complex networks containing millions of nodes and edges and efficiently analyze large-scale networks. Therefore, using GNN models for community detection has become a research hotspot. These GNN models introduce the advantages of deep learning technology into the analysis of graph structured data. They can learn the nonlinear characteristics of the network and output low-dimensional network embedding representations that maintain complex structures. The following briefly introduces some community detection algorithms based on GNN. Community detection algorithm based on graph neural network
[0004] MGAE
[12] Based on the Margin Graph Autoencoder, the community matrix and adjacency matrix are used to obtain the low-dimensional embedding representation of the node in the encoding stage, and the adjacency matrix is reconstructed in the decoding stage. The low-dimensional representation of the node is learned by maximizing the similarity between the community matrix and the adjacency matrix, and it is input into the spectral clustering algorithm to obtain the community detection result. ARGA / ARVGA learns the low-dimensional representation of the node through autoencoders and adversarial training, and then obtains the community structure by clustering the learned node representation. TGA / TVGA
[14] By taking advantage of the ternary closure property that exists in many real-world networks, a ternary decoder is constructed to consider the three edges involved in the local triple together, merge them into GAE and VGAE to learn the embedding representation of the node, and then obtain the final community division through clustering.
[15] Each node is represented as a Gaussian distribution, and through variational inference and generation process, combined with the Teacher-Student mechanism, node embedding is learned while establishing connections with communities to generate explainable clustering.
[0005] ComSHAE
[16] An autoencoder based on a graph convolutional network is used to learn the nonlinear representation of the feature vector and adjacency matrix of the weighted spectral cut, and to detect the community structure and structural hole spanner in the attribute network. Finally, a clustering algorithm is used to detect the community structure of the learned low-dimensional representation. SSGCAE
[17] A GCN-based autoencoder is provided to seamlessly and automatically fuse link information and attribute information. A goal-oriented optimization framework is used to train the autoencoder by jointly optimizing the graph reconstruction loss, modularity maximization loss, and semi-supervised loss. Then, a spectral clustering algorithm is used to perform overlapping community partitioning based on the learned low-dimensional representation. MRFastGCN
[18] The Markov Random Fields (MRF) model is used as the last layer of the graph convolutional network model. The network topology and node attribute information are utilized in the end-to-end deep network architecture. Community belonging is modeled as a discriminant problem, and the EM algorithm is used for parameter estimation and inference. The community belonging probability is iteratively optimized to achieve accurate division of the community.
[0006] GEC-CSD
[19] The encoder is constructed using the graph attention mechanism to learn the importance weights of each node and its neighboring nodes; in addition, cluster-specific distribution is introduced to construct a specificity matrix to measure the degree of association between nodes and clusters; finally, the algorithm uses the obtained node representation and the k-means algorithm to obtain community division. NMFGAAE
[20] Use NMF to decompose the node attribute matrix and get two non-negative matrices U and V. U represents the hidden layer representation of the node, and V represents the prototype matrix of the cluster. Each column represents a cluster prototype. Finally, the node representation is used for clustering to obtain the community structure. LPMPSO-GAVAE
[21] The multi-objective PSO based on label propagation and the variational autoencoder based on GAT are combined and run alternately. The output of the former is used to construct an enhancement matrix to guide the learning process of the autoencoder, and the latter obtains an embedding vector that reflects the high-order relationship of nodes. The algorithm uses the optimal solution obtained by multi-objective particle swarm optimization for clustering, and then optimizes the community division by minimizing the reconstruction error, and finally automatically obtains the community structure.
[0007] In addition to the methods mentioned above, some deep learning-based technologies, such as GAN (Generative Adversarial Nets)
[22]
[23] and DNMF (Deep Nonnegative Matrix Factorization)
[24]
[25] It is also used to complete the task of community detection. When these algorithms use GNN to detect the community structure in the network, most of them use the GNN model to learn the embedded representation of the node, and then combine it with the clustering algorithm to obtain the clustering grouping, and interpret the obtained clustering grouping as the community structure. Obviously, this process separates community detection into two independent tasks. The node representation learned in the first stage is not the optimized representation required by the clustering algorithm in the second stage, and it is likely that it does not fit the characteristics of the clustering algorithm; conversely, the clustering process in the second stage cannot provide feedback to the representation learning process in the first stage to tune the embedded representation of the node. In addition, the traditional community detection task does not use the attribute characteristics of the node. For networks that lack node attributes, the method of using the GNN model to learn node representation is not applicable. Summary of the invention
[0008] In order to solve the above problems, the present invention provides a self-supervised community detection algorithm SSGCNCD based on graph convolutional network, which adopts self-supervised learning to obtain the community structure in the network.
[0009] The technical solution adopted by the present invention is:
[0010] A self-supervised community detection algorithm based on graph convolutional network - SSGCNCD, including graph convolutional network model GCN. First, set the parameters: mainly including the node membership matrix M of the node to the community, and assign it to the unit matrix I n , the upper limit of the number of communities or the dimension K of the node representation in the embedding space, the upper limit of the number of communities K is set to Randomly initialize the weight matrix W;
[0011] Then, the GCN model is trained to obtain the node membership matrix M. The forward propagation training rule of the GCN model is:
[0012]
[0013] In the formula, M is the node membership matrix, M (I) is the node membership matrix obtained at the lth layer of GCN, whose component M ij Reflects the node v i Belongs to Society C j The possibility of I n is the identity matrix of order n; for The degree matrix of (l) It is the layer-by-layer trainable weight matrix of the neural network; σ() is the activation function, using LeakReLU.
[0014] After updating the node membership matrix M to the community in each training stage, the community is extracted in the following way: i Assigned to Society C j , where M ij is the largest value among the components in the i-th row of M, as shown in Formula 3.
[0015]
[0016] In Formula 3, K is the dimension of the node representation in the embedding space, so the dimension of the node membership matrix M is n×K;
[0017] Secondly, the nodes in the community structure that meet the conditions of close connection with the community and sparse connection with the outside of the community are defined as core nodes, and their community numbers are used as node labels. They are used as semi-supervised information to define the loss function, and the GCN model is trained in a direct learning manner;
[0018] Finally, the edge nodes are adjusted by optimizing the global modularity to determine the final community division; the algorithm is marked as SSGCNCD algorithm.
[0019] Further:
[0020] The element M of the node membership matrix M ij Refers to node v i Belongs to Society C i The possibility of node v i The method of obtaining the community structure when embedding is denoted as SSGCNCD A algorithm.
[0021] When clustering analysis is performed on the embedding representation to extract the community structure, k-means is used as the clustering algorithm to achieve this function; for the k-means algorithm, the core node is used as the initial centroid; the node membership matrix M is represented as a node embedding representation and is named SSGCNCD km algorithm.
[0022] The method for selecting the core node is as follows: select the node with the highest degree of community belonging from the community as the representative node and use it as the core node; specifically: select two key nodes in each initial community, and the selection process is divided into two steps: (1) select a node with the least external connection to the community and the largest degree in the community to which it belongs. If there are multiple such nodes, randomly select one of the nodes and record it as knode1; (2) find the second node that meets the conditions in (1) among the neighbor nodes of knode1 and mark it as knode2.
[0023] The method for optimizing global modularity is: identifying edge nodes from each community; edge nodes refer to nodes that have at least one edge connected to the outside of the community, moving these edge nodes to the community where their neighbor nodes are located, and calculating the global modularity gain after the move, and finally moving the edge nodes to the neighbor community that can obtain the maximum positive modularity gain.
[0024] The graph convolutional network model GCN has a two-layer structure.
[0025] Beneficial effects of the present invention:
[0026] The traditional idea of using graph neural networks to detect community structure is to combine node embedding representation with node clustering algorithm to obtain cluster structure. However, the combination process will inevitably result in node information loss and insufficient combination. The SSGCNCD algorithm breaks the limitations of this idea and redefines the node attribute feature matrix in the GCN propagation model as the node-to-community membership matrix to reflect the node-to-community membership. The advantage of this method is that after the GCN model is trained, the node-to-community membership matrix can directly reveal the community structure in the network, as follows:
[0027] 1. This paper implements an end-to-end community detection method based on GCN. The feature matrix in the GCN model is reinterpreted as a membership matrix, which directly reflects the affiliation between nodes and communities.
[0028] 2. The method proposed in the present invention trains GCN in a self-supervised manner. The method selects the core nodes in the community as semi-supervised information to train GCN to learn node representation, that is, the affiliation of the node to the community, without the need for the true label of the node as semi-supervised information.
[0029] 3. The method proposed in the present invention can automatically determine the number of communities. The training process of GCN can autonomously converge to a certain number of communities without pre-specifying the number of communities. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1It is a schematic diagram of the community structure in the network;
[0031] Figure 2 The detection effect of GCN with randomly initialized weight matrix: (a) the community structure obtained in the karate club network, (b) the node representation of the detection result embedded in the two-dimensional space;
[0032] Figure 3 These are the experimental results obtained by each algorithm in three networks with known community structures: (a) NMI value of community structure, (b) Q value of community structure;
[0033] Figure 4 These are the experimental results of each algorithm on 6 networks with unknown community structures;
[0034] Figure 5 The real community structure and detection results of the Karate network: (a) real community structure, (b) SSGCNCD A The detected community structure;
[0035] Figure 6 The real community structure and detection results of Dolphins network: (a) real community structure, (b) SSGCNCD A The detected community structure;
[0036] Figure 7 The real community structure and detection results of the Football network: (a) real community structure, (b) SSGCNCD A The detected community structure;
[0037] Figure 8 These are the experimental results of each algorithm on artificial synthetic networks: (a) experimental results on Sy1K network, (b) experimental results on Sy2K network, (c) experimental results on Sy5K network, and (d) experimental results on Sy10K network. DETAILED DESCRIPTION
[0038] The present invention is described in detail from different aspects below.
[0039] Part I: Detailed description of the present invention in conjunction with the accompanying drawings and specific implementation methods.
[0040] 1: About the graph convolutional network model GCN.
[0041] The SSGCNCD proposed in this paper mainly completes the task of community detection by redefining the node attribute feature matrix in the GCN model. The layer-by-layer aggregation and propagation rules of GCN are shown in formula (1):
[0042]
[0043] In the formula, I n is the identity matrix of order n; for The degree matrix of l is the layer-by-layer trainable weight matrix of the neural network; σ() is the activation function, which uses LeakReLU. For the 0th layer, the node attribute matrix X is usually used as the initial representation, that is, H (0) =X.
[0044] The study showed that untrained GCNs with random weight matrices already have the ability to roughly divide the network into clusters. Figure 2 Results are shown for a two-layer GCN with a random weight matrix implemented from the Karate Club Network, where Figure 2 The nodes drawn with different shades and shapes in (a) represent different communities. Figure 2 (b) shows the node representation embedded in the two-dimensional space by the untrained GCN model. Obviously, the nodes in the network are divided into some communities, which we call the initial community structure, and correspondingly, the points in the two-dimensional space are also grouped into some clusters, although some clusters are not clearly separated at the boundaries.
[0045] However, considering that these communities are obtained based on the embedded representation output by an untrained GCN with a random weight matrix, the detected results already have a certain degree of accuracy. If the GCN is fully trained, the quality of the final result obtained will be greatly improved. Inspired by this, the SSGCNCD algorithm proposed in the present invention uses the superior ability of GCN to detect communities in the network. The basic idea of the algorithm is relatively simple and intuitive. The weight matrix of GCN is updated backward according to the roughly divided communities, and the new GCN will generate a better community structure in the next round. Such alternating execution can train a more powerful GCN, and the community structure will be continuously optimized. However, there are two problems that need to be solved first: one is the lack of node attribute feature matrix, and the other is the lack of node labels that serve as supervisory information. Therefore, the SSGCNCD algorithm proposes the concepts of node membership matrix and core nodes. The former directly obtains the community structure by replacing the node attribute feature matrix with the node-to-community membership matrix; the latter selects core nodes from each community and uses their community numbers as semi-supervised information for GCN to be trained in a self-supervised learning manner, so that this algorithm does not need to obtain node labels in advance.
[0046] 2. The membership matrix of nodes to communities defined in the present invention
[0047] From the propagation rule of GCN expressed in Formula 1, it initially takes the node attribute feature matrix as one of its inputs in the first iteration during training, i.e., H in Formula 1 (0) =X, where X represents a matrix consisting of attributes associated with nodes in the network. However, in traditional community detection problems, the attribute information of nodes is often not paid attention to, which means that the attribute matrix is unavailable.
[0048] On the other hand, the essence of community detection is to determine the affiliation between nodes and communities, and to learn this relationship by training GCN. Therefore, the present invention reconverts the node attribute matrix into a matrix representing the affiliation between nodes and communities, that is, the node membership matrix to the community. We denote this matrix as M, and then rewrite the hierarchical aggregation and propagation rules of GCN as formula (2):
[0049]
[0050] Among them, M is the node membership matrix, M (l) is the node membership matrix obtained at the lth layer of GCN, whose component M ij Reflects the node v i Belongs to Society C j The probability of , and other symbols have the same meanings as in formula (1). For the first iteration of the GCN model, by convention, M 0 =I as the input of the original GCN, but this processing method here has another effect. This processing is equivalent to treating each node as a separate community containing only one node. It is worth noting that the change from formula (1) to formula (2) is not just a symbolic change, but a substantial functional change: the attribute of the node is transformed into the node's membership to the community. The membership matrix trained by the GCN model can directly obtain the community belonging of each node, realizing end-to-end allocation. Therefore, its working method is completely different from the original GCN.
[0051] After updating the node membership matrix M to the community in each training stage, the community can be extracted as follows: i Assigned to Society C j , where M ij is the largest value among the components in the i-th row of M, as shown in Formula 3.
[0052]
[0053] Where K is the dimension of the node representation in the embedding space, then the dimension of the node membership matrix M should be n × K. That is, M has two meanings here, and its elements M ij Point out node v i Belongs to Society Ci The possibility of node v i The method of using the first meaning of M to obtain the community structure is denoted as SSGCNCD. A , the subscript "A" indicates that community detection is performed based on the meaning of M as the node membership matrix - this leads to the issue of the value of K. Obviously, K is the number of communities extracted, which is determined by the function of the defined M. In general, including in the original GCN model, it is a hyperparameter that must be specified in advance. However, it was found in experiments that K is actually the upper limit of the number of communities. If its value is set large enough (for example, in extreme cases, K = n), then after the training process, M will eventually converge to a state where all components in some columns are 0, which means that no nodes are assigned to these communities. This phenomenon shows that the SSGCNCD algorithm can autonomously converge to a certain number of communities during the training process. Therefore, this algorithm does not need to specify the exact number of communities; instead, setting a relatively large upper limit can meet the algorithm requirements. Following previous work
[40] strategy, the SSGCNCD algorithm adopts A relaxed setting is used, which neither adds too much burden to the computation process nor misses any community.
[0054] In addition, according to the second meaning of M, the community structure can be extracted by clustering these embedded representations. The present invention uses k-means as a clustering algorithm to achieve this function. For the k-means algorithm, the core nodes defined in the present invention are used as the initial centroid. We name the way M is represented as a node embedding representation SSGCNCD km ,The subscript “km” indicates that SSGCNCD is based on the k-means clustering algorithm.
[0055] 3. Core Nodes Defined in the Present Invention
[0056] The process of training the weight matrix W in the GCN model requires the use of labeled nodes as supervisory information, and the loss function is defined using the node label distribution. After the forward propagation process of each iteration, the SSGCNCD algorithm selects core nodes from each community and uses the number of the community to which it belongs as the label of the node, thereby constructing self-supervisory information. Generally speaking, after the forward propagation process of GCN is completed, the community structure determined by the node membership matrix M to the community has some nodes whose community affiliation is incorrect, which is particularly evident in the first few iterations of the GCN training process. However, the community affiliation of the node at the center of the community is correct and credible. Therefore, considering the characteristics of dense connections between nodes within the community and sparse connections between nodes between communities, the SSGCNCD algorithm selects the node with the highest degree of community affiliation from the community as a representative node and uses it as a core node.
[0057] The SSGCNCD algorithm selects two key nodes in each initial community. The selection process is divided into two steps: (1) Select a node with the least external connections to the community and the largest degree in its community. If there are multiple such nodes, one of them is randomly selected and recorded as k. node1 ; (2) in k node1 Among the neighbor nodes of node2 .
[0058] This strategy emphasizes both the “trust distribution” of the central node to the community and the characteristic that nodes in the same community are more closely connected than nodes in different communities.
[0059] After selecting the core nodes and marking them with the numbers of the communities they belong to, SSGCNCD trains GCN in a semi-supervised manner. The present invention uses the cross entropy error as the loss function, as shown in formula (4):
[0060]
[0061] Where Y and Z are the true label of the node and the label assigned after learning by the GCN model; and Respectively represent the node v i Belong to the real community structure and the community structure obtained through the learning process belongs to community C j Here, the result of 0×log0 is allowed to be 0, so the value of the loss function and its gradient are both computable.
[0062] Obviously, the GCN in the SSGCNCD algorithm model is trained in a transductive manner, because only a small number of nodes are labeled in this algorithm. The training process uses the Adam optimizer to complete the training task to continuously learn and update all node representations.
[0063] 4: Adjusting the Community Affiliation of Edge Nodes Defined by the Present Invention
[0064] When the GCN model training process is terminated, the community structure in the network is extracted in the manner given in formula (3). However, in the experiment, it was found that in the results obtained by the above method, some nodes at the edge of the community may be misclassified. Therefore, the SSGCNCD algorithm adds a post-processing stage to optimize the quality of the final community structure.
[0065] First, we identify edge nodes from each community. An edge node is a node that has at least one edge connected to the outside of the community, e.g. Figure 2 (a) Node 3, Node 6, Node 9 and Node 26. The SSGCNCD algorithm moves these edge nodes to the community where their neighbor nodes are located, calculates the global modularity gain after the move, and finally moves the edge nodes to the neighbor community that can obtain the maximum positive modularity gain. Such edge node movement is performed only once, and the final community structure is optimized in this way.
[0066] Five: The specific implementation process of the SSGCNCD algorithm of the present invention:
[0067] In general, the SSGCNCD algorithm consists of the following steps:
[0068] Step 1: Initialize the algorithm parameters, including the upper limit of the number of communities, the membership matrix of nodes to communities, the weight parameters of GCN, etc.
[0069] Step 2: GCN forward propagation process;
[0070] Part 3: Determine the community structure based on the meaning of the elements of the node membership matrix to the community;
[0071] Part 4: Calculate the loss function and calculate the gradient;
[0072] Step 5: According to the calculated gradient, back propagate to update the node's membership matrix to the community and the GCN weight matrix;
[0073] Step 6: Repeat steps 2 to 5 T times;
[0074] Step 7: Determine the community structure based on the meaning of the elements of the membership matrix of the nodes to the community or use the K-Means algorithm to cluster the rows of the membership matrix to obtain the community structure;
[0075] Step 8: Adjust the community affiliation of the community edge nodes to obtain the final community structure.
[0076] SSGNCD that implements the above process A and SSGCNCD km The pseudo codes are shown in Algorithm 1 and Algorithm 2 respectively.
[0077]
[0078]
[0079] In SSGNCD A In the algorithm, steps 1-3 set the parameters of the algorithm and assign the node membership matrix M to the community to the unit matrix I n , the upper limit of the number of communities K is set to Randomly initialize the weight matrix W; after training the GCN model in steps 4-5, obtain the node membership matrix M; step 6 obtains the community structure based on M; step 7 adjusts the edge nodes to ensure that the community structure with the largest global modularity is obtained. km The community structure is obtained by combining the obtained node representation M with the k-means algorithm, such as SSGCNCD km This is shown in step 5 of the algorithm.
[0080] From the pseudo code, we know that the overall framework of the two methods is roughly the same, the difference lies in the community extraction method. A According to the meaning of the node membership matrix M, the community structure is directly obtained, that is, M ij The value represents the node v i Belongs to Society C j degree;SSGCNCD km The node embedding representation of each row in M is used as the attribute feature of the node, and the community structure is obtained by applying the k-means clustering algorithm.
[0081] Part 2: Verification process of the present invention.
[0082] 1. Evaluation indicators
[0083] The SSGCNCD algorithm uses modularity Q (Modularity) and normalized mutual information NMI (Normalized Mutual Information) as metrics to measure the quality of the detected community structure.
[0084] The calculation method of modularity Q is shown in formula (5):
[0085]
[0086] In the formula, A ij Represents the node v in the network i and node v j The connection weights between (elements of the adjacency matrix), k i and k j Respectively represent the node v i and node v j The degree of m is the sum of the weights of the edges in the network. i ,c j ) is the indicator function, node v i and node v j When they belong to the same community, it is 1, otherwise it is 0. Modularity measures the degree of difference between a community structure and a random graph. The greater the difference, the tighter the community structure, and vice versa. A higher modularity indicates a more significant community structure, that is, the quality of community division is better.
[0087] For two given partitions A and B, the normalized mutual information NMI is defined as shown in (6):
[0088]
[0089] Where n is the number of nodes in the network, a=|A|, b=|B|, C ij It is Club A i and B j The number of nodes that overlap between Respectively represent the A i , B j The number of nodes in the NMI is used to measure the consistency between clustering and true grouping.
[0090] 2. Experimental Dataset
[0091] The algorithm proposed in the present invention was experimented on 9 real networks and 4 groups of artificial synthetic networks to verify the performance of the algorithm. The characteristics of the networks are shown in Table 1 and Table 2. Among them, the artificial network was synthesized using the LFR benchmark network generator.
[0092] Table 1 Introduction to the experimental datasets of 9 real networks
[0093]
[0094] Table 2 Introduction to the experimental datasets of four groups of artificial synthetic networks
[0095]
[0096] In Table 1, n represents the number of nodes in the network; m represents the number of edges in the network; K represents the number of communities in the network; C refers to whether the nodes in the network have real community labels, and "Y" and "N" represent "yes" and "no" respectively. It can be seen that the actual community structures of the networks Karate, Dolphins and Football are known, while those of the remaining networks are unknown. In Table 2, n represents the number of nodes in the network; and d max Respectively represent the average degree and maximum degree of nodes in the synthetic network; exp d and exp com Respectively represent the exponents of the node degree and community size following the power law distribution; C min and C max Respectively represent the lower limit and upper limit of the number of community nodes; μ is used to control the ratio of the edges connected to the outside of each node to the edges connected to the node, and changes from 0.2 to 0.8 in increments of 0.2. For each value, 10 random networks are generated while keeping other parameters the same. The results of each algorithm on these 10 random networks are averaged to obtain the final experimental results. Such a design can more comprehensively evaluate the performance of the algorithm under different parameter settings and avoid the randomness of the experimental results.
[0097] 3. Comparison of algorithms
[0098] The experiment in this invention uses 7 comparison algorithms to compare the performance with SSGCNCD to verify its superiority. The 7 comparison algorithms are FastQ
[41] 、LPA
[42] 、GEMSEC
[43] 、RMOEA
[44] 、DANMF
[45] 、VGAE
[46] and VGAECD
[47] .
[0099] 4. Experimental results and analysis
[0100] First, set the experimental parameters. This algorithm converts the node membership matrix M to the community n×K The output dimension K in is set to This ensures that all possible communities in the network can be detected. The maximum number of iterations T is set to 200. The number of layers of the GCN model has a certain impact on the quality of the training results. In the experiment, we compared the impact of two-layer GCN and three-layer GCN on the experimental results to determine the number of layers of the GCN model. The comparison results are shown in Table 3.
[0101] Table 3 Experimental results of GCN models with different numbers of layers
[0102]
[0103] The results recorded in this table show that the performance of the two-layer GCN is significantly better than that of the three-layer GCN. The reason may be the excessive smoothing problem caused by too many layers in the three-layer GCN. Therefore, in subsequent experiments, the two-layer GCN module is used.
[0104] For each network involved in the present invention, we divide the SSGCNCD algorithm into SSGCNCD A and SSGCNCD km The two methods are verified together with other comparison algorithms. The experimental results of each algorithm in three networks with known community structures and six networks with unknown community structures are shown in Table 4.
[0105] Table 4 Experimental results of each algorithm on 9 real networks
[0106]
[0107] From Table 4, we can see that SSGNCD A The method is able to obtain the highest quality community structure from the vast majority of networks, with NMI or Q or both being the largest in these networks. Among the compared algorithms, FastQ outperforms other algorithms in modularity only on the networks Adjnoun and Lastfm asia. Similarly, RMOEA, DANMF, and VGAE obtain the best results only on the Karate network with the largest NMI value. Compared with the former two, VGAE shows better performance, achieving the largest NMI value on the Karate and Dolphins networks and the largest Q value on the Netscience network. LPA and GEMSEC cannot obtain the best results on any network. For SSGCNCD km Although it cannot obtain the maximum experimental results on any network, further research shows that it has reached the second or third place in terms of NMI value or Q value on several networks, which shows that it is very successful to replace the feature matrix in the GCN model with the node-to-community membership matrix. The node embedding trained by the GCN model can effectively capture the clustering tendency of nodes. The experimental comparison results reflect the performance advantage of the method developed by the present invention, showing the ability of the method to consistently and stably detect high-quality community structures from the network.
[0108] The first three networks, Karate, Dolphins, and Football, have real node labels, so the accuracy of the community structure identified by the algorithm can be measured by calculating the NMI value. The test results are as follows: Figure 3At the same time, the scale of these three networks is relatively small, which can well visualize the detection results. In the Karate network, SSGNCD A The maximum Q value is achieved among all the compared algorithms, but the NMI value is low. This is because the real community structure of the Karate network is 2, such as Figure 5 (a); this algorithm divides the Karate network into four community structures, such as Figure 5 As shown in (b), the partitioning at this time ensures the improvement of the global modularity Q. It is worth mentioning that during the experiment, if the node membership matrix M n×K When the output dimension K in is set to 2, SSGCNCD A The NMI value can also be 1, which is exactly the same as the real community structure. As mentioned above, K is also the upper limit of the number of communities, which means that the training process of the GCN model in the proposed method can converge to a state corresponding to a higher quality community structure. A The detected community structure has the second largest NMI value, slightly lower than the result detected by the VGAECD algorithm, but the Q value reaches the maximum. Figure 6 The real community structure and detection results of the Dolphins network show that SSGCNCD A Only nodes 8, 20, and 40 are incorrectly divided. These three nodes are edge nodes. In the edge node adjustment and optimization stage of this algorithm, these three nodes are divided into the community that guarantees the maximum global Q value. A The detection results in the Football network are the best compared to the comparison algorithm, with both NMI and Q values reaching the maximum. The real community structure of the Football network is shown in Figure 7 (a) shows, SSGCNCD A The detected community structure is as follows Figure 7 As shown in (b), it can be seen from the figure that SSGCNCD A The Football network is divided into 11 communities. In the process of community division, the algorithm merges two small communities into two larger communities. This division strategy takes into account the tight connection inside the community and the sparseness of the external connection, thereby ensuring that the detection results are close to the actual situation while the global modularity is large. Figure 3 and Figure 4 The bar graph of NMI value and Q value is given, which shows the test results and intuitively reflects the SSGCNCD A Advantages.
[0109] The experimental results of SSGCNCD algorithm and other comparison algorithms on the artificial synthetic network described in Table 2 are as follows Figure 8As shown in the figure, SSGCNCD A The algorithm has the best detection results and the maximum Q value when μ is 0.8 in Sy1K network, 0.6 in Sy2K network, 0.6 in Sy5K network and 0.4 in Sy10K network. km The Q value of the detection result is larger. In addition, the comparison algorithm shows the best detection results on individual networks. For example, LPA detects the community structure with the highest Q value when μ is 0.2 in the Sy2K network, but fails to maintain this advantage consistently. In short, the experimental results reflect the advantages of the method proposed in this invention, which can stably and consistently detect high-quality community structures from the network.
[0110] In summary, the SSGCNCD algorithm proposed in the present invention redefines the node attribute feature matrix in the GCN propagation model, replaces it with the node membership matrix of the community, and can directly assign communities to nodes according to the node membership after the model training process is completed, thereby realizing end-to-end community structure detection and avoiding the situation where node information is missing and insufficiently combined in the process of combining node representation with clustering algorithm. In addition, the SSGCNCD algorithm adopts a self-supervised approach, and uses the GCN model to randomly initialize the weight matrix to preliminarily obtain the powerful function of the community structure, assigns labels to core nodes according to the initial community structure, provides semi-supervised information, solves the problem that the real network lacks or does not have node labels, and the SSGCNCD algorithm also has the advantage of not having to pre-set the number of network communities. It can be seen from the experimental data that the SSGCNCD algorithm can obtain better experimental results in both real networks and artificial synthetic networks, which shows that it has higher performance.
[0111] References
[0112] [1]Newman M E.Modularity and community structure in networks[J].Proceedings of the national academy of sciences,2006,103(23):8577–8582.
[0113] [2] Li Hui, Chen Fucai, Zhang Jianpeng, et al. A review of community discovery algorithms in complex networks[J]. Application Research of Computers / Jisuanji Yingyong Yanjiu, 2021, 38(6).
[0114] [3]Wang Z, Wang C, Li
[0115] [4] Sun Jigui, Liu Jie, Zhao Lianyu. Research on clustering algorithms[J]. Journal of Software, 2008, 19(1): 48–61.
[0116] [5]Malliaros FD, Vazirgiannis M.Clustering and community detection indirect networks:A survey[J].Physics Reports, 2013,533(4):95–142.
[0117] [6] Lv Linyuan. Link prediction in complex networks[J]. Journal of University of Electronic Science and Technology of China, 2010, 39(5): 651–661.
[0118] [7]Chen J, Zhang D, Ming Z, et al. Graphattacker: A general multi-taskgraph attack framework [J]. IEEE Transactions on Network Science and Engineering, 2021, 9(2): 577–595.
[0119] [8] Chen Jing, Sun Linfu. Node importance evaluation in complex networks[J]. Journal of Southwest Jiaotong University, 2009, 44(3): 426–429.
[0120] [9]Wei D, Qin Y, Kong Z. The important node assessment method of satellite network based on near the center [C]. Proceedings of 2016International Conference on Network and Information Systems for Computers. IEEE, 2016, 103–107.
[0121]
[10] Lian Yifeng, Dai Yingxia, Wang Hang. User behavior anomaly detection based on pattern mining[J]. Chinese Journal of Computers, 2002, 25(3): 325–330.
[0122]
[11] Ishida K, Takena Y, Nota Y, et al. Sa-patchcore: Anomaly detection indataset with cooccurrence relationships using self-attention[J]. IEEE Access, 2023, 11: 3232–3240.
[0123]
[12] Wang C, Pan S, Long G, et al. Mgae: Marginalized graph autoencoder for graph clustering[C]. Proceedings of the 2017ACM on Conference on Informationand Knowledge Management, 2017, 889–898.
[0124]
[13] Pan S, Hu R, Long G, et al. Adversarially regularized graphautoencoder for graph embedding[J].arXiv:1802.04407,2018.
[0125]
[14] Shi H,Fan H,Kwok J T.Effective decoding in graph auto-encoding triadic closure[C].Proceedings of the AAAI Conference on ArtificialIntelligence,volume 34,2020,906–913.
[0126]
[15] Chen Z,Chen C,Zhang Z,et al.Variational graph embedding andclustering with Laplacian eigenmaps[C].Proceedings of the 28th InternationalJoint Conference on Artificial Intelligence,2019,2144–2150.
[0127]
[16] Luo J,Du Y.Detecting community structure and structural holespanner simultaneously by using graph convolutional network based auto-encoder[J].Neurocomputing,2020,410:138–150.
[0128]
[17] He C,Zheng Y,Cheng J,et al.Semi-supervised overlapping communitydetection in attributed graph with graph convolutional autoencoder[J].Information Sciences,2022,608:1464–1479.
[0129]
[18] Jin D,Liu Z,Li W,et al.Graph convolutional networks meet markovrandom fields:Semi-supervised community detection in attribute networks[C].Proceedings of the AAAI Conference on Artificial Intelligence,volume 33,2019,152–159.
[0130]
[19] He C,Zheng Y,Fei X,et al.Boosting nonnegative matrixfactorization based community detection with graph attention auto-encoder[J].IEEE Transactions on Big Data,2021,8(4):968–981.
[0131]
[20] Guo K,Chen Z,Lin X,et al.Community detection based onmultiobjective particle swarm optimization and graph attention variationalautoencoder[J].IEEE Transactions on Big Data,2022,9(2):569–583.
[0132]
[21] Gao H,Pei J,Huang H.Progan:Network embedding via proximitygenerative adversarial network[C].Proceedings of the 25th ACM SIGKDDInternational Conference on Knowledge Discovery&Data Mining,2019,1308–1316.
[0133]
[22] Jia Y,Zhang Q,Zhang W,et al.Communitygan:Community detection withgenerative adversarial nets[C].Proceedings of The WorldWide Web Conference,2019,784–794.
[0134]
[23] Ye F,Chen C,Zheng Z.Deep autoencoder-like nonnegative matrixfactorization for community detection[C].Proceedings of the 27th ACMInternational Conference on Information and Knowledge Management,2018,1393–1402.
[0135]
[24] Huang J,Zhang T,Yu W,et al.Community detection based onmodularized deep nonnegative matrix factorization[J].International Journal ofPattern Recognition and Artificial Intelligence,2021,35(02):2159006.
[0136]
[25] Xie J,Girshick R,Farhadi A.Unsupervised deep embedding forclustering analysis[C].Proceedings of International Conference on MachineLearning.PMLR,2016,478–487.
[0137]
[26] Cheng J,Zhao S,Yang H,et al.Detecting communities from networksusing an improved self-organizing map[J].International Journal of ModernPhysics C,2019,30(06):1950054.
[0138]
[27] Blondel V D,Guillaume J L,Lambiotte R,et al.Fast unfolding ofcommunities in large networks[J].Journal of statistical mechanics:Theory andExperiment,2008,2008(10):P10008.
[0139]
[28] Raghavan U N,Albert R,Kumara S.Near linear time algorithm todetect community structures in large-scale networks[J].Physical Review E,2007,76(3):036106.
[0140]
[29] Rozemberczki B,Davies R,Sarkar R,et al.Gemsec:Graph embeddingwith self clustering[C].Proceedings of the 2019 IEEE / ACM InternationalConference on Advances in Social Networks Analysis and Mining,2019,65–72.
[0141]
[30] Zhang X,Zhou K,Pan H,et al.A network reduction-basedmultiobjective evolutionary algorithm for community detection in large-scalecomplex networks[J].IEEE Transactions on Cybernetics,2018,50(2):703–716.
[0142]
[31] Ye F,Chen C,Zheng Z.Deep autoencoder-like nonnegative matrixfactorization for community detection[C].Proceedings ofthe 27th ACMInternational Conference on Information and Knowledge Management,2018,1393–1402.
[0143]
[32] KipfT N,Welling M.Variational graph auto-encoders[J].arXiv:1611.07308,2016.
[0144]
[33] Choong J J,Liu X,Murata T.Learning community structure withvariational autoencoder[C].Proceedings of 2018 IEEE International Conferenceon Data Mining.IEEE,2018,69–78。
Claims
1. A self-supervised community detection algorithm based on graph convolutional network - SSGCNCD, including a graph convolutional network model GCN, characterized in that: First, set the parameters: mainly including the node membership matrix M of the node to the community, and assign it to the unit matrix I n , the upper limit of the number of communities or the dimension K of the node representation in the embedding space, the upper limit of the number of communities K is set to Randomly initialize the weight matrix W; Then, the GCN model is trained to obtain the node membership matrix M. The forward propagation training rule of the GCN model is: In the formula, M is the node membership matrix, M (l) is the node membership matrix obtained at the lth layer of GCN, whose component M ij Reflects the node v i Belongs to Society C j The possibility of I n is the identity matrix of order n; for The degree matrix of (l) It is the layer-by-layer trainable weight matrix of the neural network; σ() is the activation function, using LeakReLU. After updating the node membership matrix M to the community in each training stage, the community is extracted in the following way: i Assigned to Society C j , where M ij is the largest value in the i-th row component of M, as shown in Formula 3, In Formula 3, K is the dimension of the node representation in the embedding space, so the dimension of the node membership matrix M is n×K; Secondly, the nodes in the community structure that meet the conditions of close connection with the community and sparse connection with the outside of the community are defined as core nodes, and their community numbers are used as node labels. They are used as semi-supervised information to define the loss function, and the GCN model is trained in a direct learning manner; Finally, the edge nodes are adjusted by optimizing the global modularity to determine the final community division; the algorithm is marked as SSGCNCD algorithm.
2. According to claim 1, a self-supervised community detection algorithm based on graph convolutional network - SSGCNCD, characterized in that: The element M of the node membership matrix M ij Refers to node v i Belongs to Society C i The possibility of node v i The method of obtaining the community structure when embedding is denoted as SSGCNCD A algorithm.
3. According to claim 2, a self-supervised community detection algorithm based on graph convolutional network - SSGCNCD, characterized in that: When clustering analysis is performed on the embedding representation to extract the community structure, k-means is used as the clustering algorithm to achieve this function; for the k-means algorithm, the core node is used as the initial centroid; the node membership matrix M is represented as a node embedding representation and is named SSGCNCD km algorithm.
4. According to claim 1, a self-supervised community detection algorithm based on graph convolutional network - SSGCNCD, characterized in that: The method for selecting the core node is: selecting the node with the highest degree of community belonging determination from the community as the representative node, and making it the core node; Specifically, two key nodes are selected in each initial community. The selection process is divided into two steps: (1) Select a node with the least external connections to the community and the largest degree in its community. If there are multiple such nodes, randomly select one of them and record it as knode1; (2) Find the second node that meets the conditions in (1) among the neighbor nodes of knode1 and mark it as knode2.
5. According to claim 1, a self-supervised community detection algorithm based on graph convolutional network - SSGCNCD, characterized in that: The method for optimizing global modularity is: identifying edge nodes from each community; edge nodes refer to nodes that have at least one edge connected to the outside of the community, moving these edge nodes to the community where their neighbor nodes are located, and calculating the global modularity gain after the move, and finally moving the edge nodes to the neighbor community that can obtain the maximum positive modularity gain.
6. According to claim 1, a self-supervised community detection algorithm based on graph convolutional network - SSGCNCD, characterized in that: The graph convolutional network model GCN has a two-layer structure.
Citation Information
Cited By
Hypergraph enhanced semi-supervised graph reconstruction method and overlapping community detection method
CN120823460A
