# General Community Detection in Attributed Networks with Consistent-Module Constrained Nonnegative Matrix Factorization

Authors: Yafang Li; Yuanda Liu; Jianwen Wei; Baokai Zu; Hongyuan Wang
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

Nonnegative matrix factorization (NMF) model has been successfully applied to discover latent community structures due to its good performance and interpretability advantages in extracting hidden patterns. However, most previous studies explore only the structural information of the network while ignoring the rich attributes. Besides, they aim at detecting densely connected communities (also called community structures) and fail to identify general structures, such as bipartite structures and mixture structures. In this paper, we research on general structure discovery and propose a new method GCDNMF (General Community Detection based on Nonnegative Matrix Factorization), which integrates structural information and node attributes through consistency module constraint to capture the community interactions. It can discover the general community structures of nodes by iteratively updating the community-interaction matrix and the node-membership matrix. We also introduce matrix initialization based on centrality and dispersion of nodes for center selection to reduce the sensitivity of random initialization. Experimental results on real-world networks with a variety of characteristics validate the performance of our approach, especially on networks with general structures. In addition, the associated initialization evaluations demonstrate the effectiveness of our method in obtaining stable results.


---

## Body

## 1. Introduction

Many complex systems in the real world can be described as networks, such as social networks, transportation networks, and citation networks. Community structure is an essential and common topological property in these networks. The identification of community structure is a fundamental issue in understanding network topology and functional modules, and it has attracted the attention of many researchers [1–9]. A comprehensive review of existing community detection methods can be found in the literature [10]. Furthermore, with the rapid emergence of user-generated media(e.g., Microblog, WeChat, and Twitter), while structural connections between nodes indicate various interdependencies between individuals or organizations [6], real-world networks also contain rich attribute information that characterizes nodes and are referred to as attribute networks. As revealed in previous work, informative node attributes can help to find meaningful groups of users with similar interests, backgrounds, or purposes, which can further effectively support applications in recommendation, sentiment analysis, and user profiling [11]. Moreover, realistic complex networks often contain multiple structures, in addition to the traditional community structure, also known as assortative mixing, i.e., defined as a structure with tight intra-community node links and sparse inter-community links, such as the classical citation network Cora dataset; they also contain multiple complex network structures, such as the bipartite network [12] generated by the English lexical link network Adjnoun, and mixture structures containing both structures, also called disassortative mixing [13]. Mining the various underlying structures and interaction patterns between communities in a network is of great theoretical and practical significance for understanding the function of networks, discovering hidden patterns and predicting the behavior of individuals in the network.In the past decades, several methods have been proposed to detect communities in attributed networks. They are mainly classified into modularity based methods [14, 15], clustering based methods [16–20], random walk based methods [21, 22], statistical inference models [13, 23, 24], and matrix factorization based methods [3, 25–27]. Among them, nonnegative matrix factorization (NMF) based methods have attracted much interest due to their good performance and strong interpretability. For example, Jia et al. [28] developed a modularized trifactor matrix factorization model Mtrinmf to exploit the topological and the modularity information of the network. Zhang et al. [3] used the NMF method to improve density peak clustering in community detection. However, node attributes are not considered in these models. To introduce node attributes, Jin et al. [29] used the node attribute matrix to construct a NMF framework for underlying community membership. Chen et al. [27] proposed CDCN by combining node attribute information and community structure information using the NMF framework to identify communities with semantic annotation. However, above attributed methods commonly assumed that the community structure obtained from the link structure is consistent with the community structure obtained from node attribute mining. Hence, they embed the structure and attribute into the same space and obtain the common node community matrix. In this way, they typically aim to extract traditional communities that are assortative, i.e. nodes are mostly connected with others in the community. They may overlook intercommunity relationship, making it difficult to exploit the generalized community structures, including assortative communities, disassortative communities, i.e. most connections are from different communities(such as bipartite networks), or the mixed community structures.To address these issues, in this paper, we research on discovering general structures and propose a new nonnegative matrix factorization model named GCDNMF. It integrates the structural information and node attributes of networks through consistency module constraints to capture the interactions between communities. By iteratively updating the community-interaction matrix and node-membership matrix, it captures the general community structures of nodes. In addition, we initialize the initial matrix by the centrality and dispersion of nodes to reduce the sensitivity caused by random initialization. In summary, the innovation of this paper is threefold:(1)
We propose a novel NMF-based model to detect general structures in attribute networks, which naturally combines structural connections and node attributes into a joint decomposition model. To the best of our knowledge, we are the first to model the general structures using the NMF-based model.(2)
We propose consensus factorization to exploit general communities by studying the consistency between nodes and communities in terms of structural connections and node attributes. It is addressed by alternately updating the community-interaction matrix in the link structure and node-membership matrix in the node attributes.(3)
Extensive experiments are conducted on benchmark networks to demonstrate the effectiveness of our proposed method by comparing it with the state-of-the-art methods. The experimental results show the superior performance of our model in detecting general structures.The remainder of this paper is organized as follows. Section2 introduces the related work on community detection based on nonnegative matrix factorization. Section 3 presents our proposed GCDNMF model which integrates the topological information and node attributes based on consistent-model constraints. To verify the performance of our method, several experiments are carried out in Section 4. Section 5 draws the conclusion and gives further consideration.


## 2. Related Work

Nonnegative matrix factorization (NMF) has good capability in extracting hidden patterns and structures from high-dimensional data. Kumari et al. [30] pioneered a standard community detection method based on NMF, which can effectively mine the structural characteristics of the community by quantifying the link relationships between nodes. Owing to its advantages of simple implementation, innate interpretability, and outstanding performance, it has become a vital technique for community detection [31] and has attracted much attention by researchers to improve the performance of NMF-based community detection.For directed and undirected networks classified according to the directionality of edges, Kuncheva et al. [32] proposed SNMF and ANMF to extract the intrinsic community structures, respectively. Considering the modularity information of the network, Jia et al. [28] presented a trifactor NMF model that combines the modularity information as a regularization term. To further capture the complex underlying network structure effectively and preserve the global and local structures, Li et al. [33] proposed a multilayer model based on NMF, which consists of an encoder module and a decoder module. Li et al. [34] explored the implicit association between nodes and presented a community detection method based on SNMF. However, the above conventional methods mainly explore the topology of the network to obtain communities.Some of the most recently developed state-of-the-art methods use both topology and attribute to extract communities. Jin et al. [29] utilized the NMF technique to combine the observed network structure and node attributes, but the model does not focus on factorizing the node attributes matrix and ignores the various implications of edges in forming the community structure. Li and Liu [35] proposed a trifactor nonnegative matrix factorization clustering framework NMTF to combine three types of graph regularization in social networks. This approach utilizes additional content information to detect communities, and fails to explore the relationship between communities and this content. Tang et al. [36] proposed a weighted nonnegative factorization method for attributed graph clustering, which incorporates a weighting scheme to distinguish the importance of attributes. Jin et al. utilized both the community structure matrix and the node attribute matrix in NMF framework SCI [29]. Chen et al. [27] combined node attribute information and community structure information in the NMF framework to accurately find the relationships between networks. Some recent research work focus on building NMF model to learn low-dimensional representation of nodes for discovering communities in attributed networks [33, 37].


## 3. The GCDNMF Model

In this section, we present the proposed general community detection method GCDNMF, which incorporates topological information and node attribute in a collective NMF-based model. It consists of three main parts: network structure modeling, node attribute modeling, and joint modeling. Next, we describe each part in detail and give the optimization method.


### 3.1. Problem Formulation

We denote a network asG=V,E,C, where V is a set of n nodes, E is the set of edges between nodes, and C is a set of attribute vectors. The n nodes and their connections are interpreted by an adjacency matrix A, if nodes i and j are connected, the corresponding entry Aij=1, otherwise Aij=0. The attributes of nodes in the network are represented by an attribute matrix C∈Rn×m, where m is the dimension of node attributes. Our proposed method aims to partition the network G into k communities by jointly decomposing the adjacency matrix A and the attribute matrix C. In this paper, we summarize the notations and their definitions in Table 1.Table 1
Notations utilized in the paper.
NotationsDescriptionsAAij=1 if there is an edge between nodes vi and vj; 0 otherwiseCCij=1 if node vi has attribute j; 0 otherwiseHHic is the propensity of node vi belonging to community cGGij is the probability of edges between community i and jQQic is the probability of node vi belonging to text cluster cVVjc is the propensity of a node in cluster c having attribute jVSet of nodes in a networkESet of edges in a networkCSet of attributes in a networkkNumber of communities


### 3.2. Modeling Network Structures

Community detection refers to find those nodes with relatively close relationship from a network and divide them into different communities. The idea that the parts constitute the whole in the nonnegative matrix factorization provides an effective solution to this problem. To model the topological structure of nodes, we improve the traditional NMF method and propose a three-factor factorization method to decompose the adjacency matrixA. The objective function can be expressed as:
(1)minA−HGHTF2s.t.H≥0,G≥0,where H∈Rn×k is the community membership matrix, in which Hij indicates the propensity of node i belonging to community j; G∈Rk×k is the community relation matrix and Gij is the probability of edges existing between community i and community j. Intuitively, G is used as a measure of the strength of relationships between communities. Compared with the traditional NMF method, this method adopts a trifactor decomposition instead of a two-factor decomposition. On the one hand, the trifactor NNF model is suitable for both directed and undirected networks. More importantly, it has a clear physical meaning for H and G. The relation matrix G is further combined with node attribute modeling to exploit the generalized community structure.


### 3.3. Modeling Node Attributes

In attribute networks, nodes and their correlated attributes can be regarded as the relationship between documents and keywords. Using the bag-of-words approach, the attribute matrix is denoted asC∈Rn×m, where n represents the number of documents and m is the number of keyword features. Assuming that the documents consists of k clusters, based on NMF text clustering, C can be decomposed into two nonnegative matrices Q∈Rn×k and V∈Rm×k. We then have the following objective function related to the node attributes:
(2)minC−QVTF2s.t.Q≥0,V≥0,where Q is the probability distribution matrix between nodes and communities, Qic represents the membership degree of node i belonging to community c. V is the probability distribution matrix between node attributes and communities, and Vjc indicates the propensity that community c can be describe by keyword j. In this way, we can divide the communities by node attributes and obtain attribute community matrix Q, which indicates that nodes in the same attribute community have a large attribute similarity.


### 3.4. Joint Community Detection Model

In the above two subsections, the community detection results are obtained from two perspectives of structural information and node attributes, respectively. To ensure that the final result is consistent, GCDNMF introduces a consistency module to jointly formulate the above two aspects. Different from traditional methods that focus on embedding structures and attributes into the common node-community space, we also concentrate on the relationship matrix between communities. Intuitively, based on attribute community matrixQ, we can further obtain the matrix describing the relationship between communities in the attribute information by QTQ. Specifically, each entry in QTQ portrays two communities in which nodes have attribute similarity and indicates the propensity of edges existing between two communities based on attribute similarity.Considering that the topology is consistent with the clustering structure of the node attributes, the structure community relation matrixG and the attribute community relation matrix QTQ obtained are inclined to be approximated. Therefore, we derive the following objection function:
(3)minG−QTQF2s.t.G≥0,Q≥0.Then, we propose a weighted joint NMF-based framework to integrate above objectives. Our goal is to minimize the following optimization problem overH, G, Q, and V:
(4)L=A−HGHTF2+αC−QVTF2+βG−QTQF2,s.t.H≥0,G≥0,Q≥0,V≥0,where α and β are positive weights to balance the structure/attribute fusion and the strength of consistency constraint on the community relationship.


### 3.5. Model Optimization

Since minimizing Eq. (4) with respect to H, G, Q, and V is not convex in all variables together, we utilize an alternating iterative updating scheme to optimize the objective for convergence to a local minimum. First, according to matrix properties TrAB=TrBA and TrAT=TrA, the objective function can be derived to the following form:
(5)minH,G,Q,V≥0L=TrAAT+HGHTHGTHT−2AHGTHT+αTrCQCT+QVTVQT−2CVQT+βTrGGT+QTQQTQ−2GQTQ.To optimize Eq. (5), w.r.t. H, G, Q, and V, four Lagrangian multipliers are introduced, λH∈Rn×k, λG∈Rn×n, λQ∈Rn×k, and λV∈Rm×k. According to Karush-Kuhn-Tucker(KKT) condition, which characterizes the necessary and sufficient condition that the optimal solutions need to satisfy:
(6)λH⊗H=0,λG⊗G=0,λQ⊗Q=0,λV⊗V=0.where ⊗ is the Hadamard product operator(like the operator ‘.∗’ in matlab), for example, A⊗Bij=Aij.∗Bij. Thus, we derive the Lagrange function:
(7)minH,G,Q,V≥0L=TrAAT+HGHTHGTHT−2AHGTHT+αTrCQCT+QVTVQT−2CVQT+βTrGGT+QTQQTQ−2GQTQ+TrλHHT+TrλGGT+TrλQQT+TrλVVT.Setting partial derivatives ofG, Q, V, and H to zero, we have:
(8)∂L∂G=2HTHGHTH−2HTAH+2βG−2βQTQ+λG=0,∂L∂Q=2αQVTV−2αCV+4βQQTQ−4βQG+λQ=0,∂L∂V=2αVQTQ−2αCTQ+λV=0,∂L∂H=4HGHTHGT−4AHGT+λH=0.To eliminate Lagrangian multipliers by Eq. (7), we obtain:
(9)HTHGHTH−HTAH+βG−βQTQijGij=0,αQVTV−αCV+2βQQTQ−2βQGijQij=0,VQTQ−CTQijVij=0,HGHTHGT−AHGTijHij=0.From Eq. (9), we obtain the following updating formulas:
(10)G=G⊗HTAH+βQTQHTHGHTH+βG,Q=Q⊗αCV+2βQGαQVTV+2βQQTQ,V=V⊗CTQVQTQ,H=H⊗AHGTHGHTHGT.


### 3.6. Initialization of GCDNMF

Since the NMF-based approach is sensitive to random initial values of the variables, to overcome this problem, the node membership matrixH of our model is initialized based on our previously presented work K-rank-D [38], which utilizes the centrality and dispersion of the network to determine the cluster centers.To formulate the centrality of nodes in the network, according to the algorithm in [38], by modifying the transition probability matrix P, where Pij=Aij/∑jAij, we get the centrality of nodes by:
(11)P¯i=Pi+∑jexp−dij2Pi,where dij is the Euclidean distance between node i and node j. The nodes with higher centrality are more likely to be selected as the center points. What is more, as in real networks, the distance between community centers is usually far from each other, to measure the degree of dispersion among centers, a dispersion measurement by computing the distance between node i and other nodes with higher centrality is defined as:
(12)δi=minj:P¯j>P¯idij.According to the centrality and dispersion of nodes formulated as Eq. (11) and Eq. (12). The CV (comprehensive value) of any node i in the network can be defined as:
(13)CVi=P¯iδimax1≤i≤nP¯imax1≤i≤nδ¯i.We sort the CV values of all nodes in descending order and select thek node with the highest CV value as the center of the network. Then we chose the k columns(corresponding to the selected k centers) in the similarity matrix S=A+Iτ to obtain the initialized H matrix, where I is an n-dimensional identity matrix and τ is the step length of signal propagation, and we take this value as τ=3 in this paper.


### 3.7. The GCDNMF Algorithm

Algorithm1 outlines our proposed GCDNMF. Taking the adjacency matrix A, the attribute matrix C and the number of communities k as input, after initializing the initial matrix, the membership matrix of nodes H is obtained by iteratively update. Finally, the community partition result of nodes is obtained by the maximum assignment. The GCDNMF algorithm is decreasing with step 4 to step 7 and converges to a local optimum. Since k≪n, β, and α are constant, the complexity of updating G, Q, V, and H is OTn2k+mnk for T iterations. With well initialization based on centrality and dispersion of nodes, GCDNMF can converge quickly and reduce required iterations largely in partitioning nodes of a network. Generally, 100 iterations will give a promising performance.


## 3.1. Problem Formulation

We denote a network asG=V,E,C, where V is a set of n nodes, E is the set of edges between nodes, and C is a set of attribute vectors. The n nodes and their connections are interpreted by an adjacency matrix A, if nodes i and j are connected, the corresponding entry Aij=1, otherwise Aij=0. The attributes of nodes in the network are represented by an attribute matrix C∈Rn×m, where m is the dimension of node attributes. Our proposed method aims to partition the network G into k communities by jointly decomposing the adjacency matrix A and the attribute matrix C. In this paper, we summarize the notations and their definitions in Table 1.Table 1
Notations utilized in the paper.
NotationsDescriptionsAAij=1 if there is an edge between nodes vi and vj; 0 otherwiseCCij=1 if node vi has attribute j; 0 otherwiseHHic is the propensity of node vi belonging to community cGGij is the probability of edges between community i and jQQic is the probability of node vi belonging to text cluster cVVjc is the propensity of a node in cluster c having attribute jVSet of nodes in a networkESet of edges in a networkCSet of attributes in a networkkNumber of communities


## 3.2. Modeling Network Structures

Community detection refers to find those nodes with relatively close relationship from a network and divide them into different communities. The idea that the parts constitute the whole in the nonnegative matrix factorization provides an effective solution to this problem. To model the topological structure of nodes, we improve the traditional NMF method and propose a three-factor factorization method to decompose the adjacency matrixA. The objective function can be expressed as:
(1)minA−HGHTF2s.t.H≥0,G≥0,where H∈Rn×k is the community membership matrix, in which Hij indicates the propensity of node i belonging to community j; G∈Rk×k is the community relation matrix and Gij is the probability of edges existing between community i and community j. Intuitively, G is used as a measure of the strength of relationships between communities. Compared with the traditional NMF method, this method adopts a trifactor decomposition instead of a two-factor decomposition. On the one hand, the trifactor NNF model is suitable for both directed and undirected networks. More importantly, it has a clear physical meaning for H and G. The relation matrix G is further combined with node attribute modeling to exploit the generalized community structure.


## 3.3. Modeling Node Attributes

In attribute networks, nodes and their correlated attributes can be regarded as the relationship between documents and keywords. Using the bag-of-words approach, the attribute matrix is denoted asC∈Rn×m, where n represents the number of documents and m is the number of keyword features. Assuming that the documents consists of k clusters, based on NMF text clustering, C can be decomposed into two nonnegative matrices Q∈Rn×k and V∈Rm×k. We then have the following objective function related to the node attributes:
(2)minC−QVTF2s.t.Q≥0,V≥0,where Q is the probability distribution matrix between nodes and communities, Qic represents the membership degree of node i belonging to community c. V is the probability distribution matrix between node attributes and communities, and Vjc indicates the propensity that community c can be describe by keyword j. In this way, we can divide the communities by node attributes and obtain attribute community matrix Q, which indicates that nodes in the same attribute community have a large attribute similarity.


## 3.4. Joint Community Detection Model

In the above two subsections, the community detection results are obtained from two perspectives of structural information and node attributes, respectively. To ensure that the final result is consistent, GCDNMF introduces a consistency module to jointly formulate the above two aspects. Different from traditional methods that focus on embedding structures and attributes into the common node-community space, we also concentrate on the relationship matrix between communities. Intuitively, based on attribute community matrixQ, we can further obtain the matrix describing the relationship between communities in the attribute information by QTQ. Specifically, each entry in QTQ portrays two communities in which nodes have attribute similarity and indicates the propensity of edges existing between two communities based on attribute similarity.Considering that the topology is consistent with the clustering structure of the node attributes, the structure community relation matrixG and the attribute community relation matrix QTQ obtained are inclined to be approximated. Therefore, we derive the following objection function:
(3)minG−QTQF2s.t.G≥0,Q≥0.Then, we propose a weighted joint NMF-based framework to integrate above objectives. Our goal is to minimize the following optimization problem overH, G, Q, and V:
(4)L=A−HGHTF2+αC−QVTF2+βG−QTQF2,s.t.H≥0,G≥0,Q≥0,V≥0,where α and β are positive weights to balance the structure/attribute fusion and the strength of consistency constraint on the community relationship.


## 3.5. Model Optimization

Since minimizing Eq. (4) with respect to H, G, Q, and V is not convex in all variables together, we utilize an alternating iterative updating scheme to optimize the objective for convergence to a local minimum. First, according to matrix properties TrAB=TrBA and TrAT=TrA, the objective function can be derived to the following form:
(5)minH,G,Q,V≥0L=TrAAT+HGHTHGTHT−2AHGTHT+αTrCQCT+QVTVQT−2CVQT+βTrGGT+QTQQTQ−2GQTQ.To optimize Eq. (5), w.r.t. H, G, Q, and V, four Lagrangian multipliers are introduced, λH∈Rn×k, λG∈Rn×n, λQ∈Rn×k, and λV∈Rm×k. According to Karush-Kuhn-Tucker(KKT) condition, which characterizes the necessary and sufficient condition that the optimal solutions need to satisfy:
(6)λH⊗H=0,λG⊗G=0,λQ⊗Q=0,λV⊗V=0.where ⊗ is the Hadamard product operator(like the operator ‘.∗’ in matlab), for example, A⊗Bij=Aij.∗Bij. Thus, we derive the Lagrange function:
(7)minH,G,Q,V≥0L=TrAAT+HGHTHGTHT−2AHGTHT+αTrCQCT+QVTVQT−2CVQT+βTrGGT+QTQQTQ−2GQTQ+TrλHHT+TrλGGT+TrλQQT+TrλVVT.Setting partial derivatives ofG, Q, V, and H to zero, we have:
(8)∂L∂G=2HTHGHTH−2HTAH+2βG−2βQTQ+λG=0,∂L∂Q=2αQVTV−2αCV+4βQQTQ−4βQG+λQ=0,∂L∂V=2αVQTQ−2αCTQ+λV=0,∂L∂H=4HGHTHGT−4AHGT+λH=0.To eliminate Lagrangian multipliers by Eq. (7), we obtain:
(9)HTHGHTH−HTAH+βG−βQTQijGij=0,αQVTV−αCV+2βQQTQ−2βQGijQij=0,VQTQ−CTQijVij=0,HGHTHGT−AHGTijHij=0.From Eq. (9), we obtain the following updating formulas:
(10)G=G⊗HTAH+βQTQHTHGHTH+βG,Q=Q⊗αCV+2βQGαQVTV+2βQQTQ,V=V⊗CTQVQTQ,H=H⊗AHGTHGHTHGT.


## 3.6. Initialization of GCDNMF

Since the NMF-based approach is sensitive to random initial values of the variables, to overcome this problem, the node membership matrixH of our model is initialized based on our previously presented work K-rank-D [38], which utilizes the centrality and dispersion of the network to determine the cluster centers.To formulate the centrality of nodes in the network, according to the algorithm in [38], by modifying the transition probability matrix P, where Pij=Aij/∑jAij, we get the centrality of nodes by:
(11)P¯i=Pi+∑jexp−dij2Pi,where dij is the Euclidean distance between node i and node j. The nodes with higher centrality are more likely to be selected as the center points. What is more, as in real networks, the distance between community centers is usually far from each other, to measure the degree of dispersion among centers, a dispersion measurement by computing the distance between node i and other nodes with higher centrality is defined as:
(12)δi=minj:P¯j>P¯idij.According to the centrality and dispersion of nodes formulated as Eq. (11) and Eq. (12). The CV (comprehensive value) of any node i in the network can be defined as:
(13)CVi=P¯iδimax1≤i≤nP¯imax1≤i≤nδ¯i.We sort the CV values of all nodes in descending order and select thek node with the highest CV value as the center of the network. Then we chose the k columns(corresponding to the selected k centers) in the similarity matrix S=A+Iτ to obtain the initialized H matrix, where I is an n-dimensional identity matrix and τ is the step length of signal propagation, and we take this value as τ=3 in this paper.


## 3.7. The GCDNMF Algorithm

Algorithm1 outlines our proposed GCDNMF. Taking the adjacency matrix A, the attribute matrix C and the number of communities k as input, after initializing the initial matrix, the membership matrix of nodes H is obtained by iteratively update. Finally, the community partition result of nodes is obtained by the maximum assignment. The GCDNMF algorithm is decreasing with step 4 to step 7 and converges to a local optimum. Since k≪n, β, and α are constant, the complexity of updating G, Q, V, and H is OTn2k+mnk for T iterations. With well initialization based on centrality and dispersion of nodes, GCDNMF can converge quickly and reduce required iterations largely in partitioning nodes of a network. Generally, 100 iterations will give a promising performance.


## 4. Experimental Results and Analysis

In this paper, to verify the effectiveness of our proposed method, we compared against the sate-of-the-art community detection method based on NMF model. The average results with 10 trials were recorded. All the algorithms were ran on a PC with RAM:8.0GB, CPU: Intel i7-4600 U, and Platform: MATLAB 2014b.Algorithm 1: GCDNMF Algorithm.
Input: Adjacency matrix A;Attribute matrixC;Number of communitiesk;Number of iterationsiter;Output: Community label li for each node i1: initializeG, Q and V randomly2: initializeH by K-rank-D3: fort=1:iter do4:G=G⊗HTAH+βQTQ/HTHGHTH+βG5:Q=Q⊗αCV+2βQG/αQVTV+2βQQTQ6:V=V⊗CTQ/VQTQ7:H=H⊗AHGT/HGHTHGT8: end for9: returnli=argmaxr≤kHir


### 4.1. Data Description

We used both synthetic and real-world networks to test the effectiveness of our proposed algorithm. The details of these datasets are given below, and the detailed parameters of the data are given in Table2.
(1)
Cora the Cora dataset is a subset of the large Cora citation dataset. It contains 2708 research papers from seven subfields of machine learning. In this network, each node is characterized by a 0/1-valued word vector indicating the absence/presence of the corresponding word from the dictionary, which consists of 1703 unique words.(2)
Citeseer the Citeseer dataset is a citation network of computer science publications. It contains 3312 publications, each of which is labeled as one of 6 categories. Similar to Cora dataset, each publication is described as one binary vector indicating the presence or absence of the corresponding word from a dictionary of 3703 unique words.(3)
WebKB the WebKB dataset consists of 877 scientific publications and 1608 links, which includes Web page networks of four universities: Cornell, Texas, Washington, and Wisconsin.Table 2
Details of the real-world network datasets utilized in the experiments, whereN, E, M, and K are the number of nodes, edges, attributes, and communities, respectively, where ‘AVD’, ‘CC’, and ‘ASC’ represent the average degree, clustering coefficient, and assortative coefficient.
NetworksNEMK‘AVD’‘CC’‘ASC’Cora27085429143373.890.241-0.065Citeseer33124732370362.730.1420.047Cornell195304170352.900.157-0.241Texas187328170353.090.303-0.250Wisconsin265530170353.180.278-0.179Washington230446170353.540.197-0.223According to the block matrices of the networks, the first two datasets are assortative mixing(traditional community structure) as shown in Figure1(a) taking the Cora dataset as example, while the WebKB datasets is mixture structure, which is neither assortative mixing nor disassortative mixing(e.g.,bipartite structure or multipartitie structure) show in Figure 1(b) taking the Washington dataset as example.Figure 1
The gray-scale images of community-relation matrices, namely, the block matrices of the networks. Each block represents the link probabilities between the corresponding community pair, and darker colors of the blocks correspond to larger link probability.
(a)
Cora(b)
Washington


### 4.2. Evaluation Measurements

In this study, three commonly used metrics are used to measure the performance of an algorithm, accuracy (ACC) [39], normalized mutual information (NMI) [39], and Pairwise F-measure (PWF) [40]. These metrics are defined as follows.
(1)
Accuracy (ACC). Given nodei, lpi is the assigned label by an algorithm, and lti is the true label. The accuracy is defined as the fraction of all nodes whose predicted labels are the same with the true labels. The ACC of a particular division of a network is defined as follows:(14)ACC=∑i=1nδlti,pmaplpin,where δx,y is a Kronecker function that the value is 1 if x=y, otherwise, 0. pmaplpi is a permutation mapping function that maps the label lpi of node i to the corresponding label in the ground-truth. n is the overall number of nodes in a network.
(2)
Normalized mutual information (NMI). The NMI is defined by:(15)NMIC,C′=−2∑i=1K∑j=1K′nijlognijn/niCnjC′∑i=1KniClogniC/n+∑j=1K′njC′lognjC′/n,where C is the ground-truth cluster label, C′ is the computed cluster label, K is the number of communities, niC is the number of nodes in the ground-truth community i, njC′ is the number of nodes in the computed community j, nij is the number of nodes in the ground-truth community i that are assigned to the computed community j. In general, the higher NMI, the better result an algorithm get.
(3)
PairwiseF-measure (PWF). Let LT denote the set of nodes having the same community label in the ground-truth, and LS be the set of nodes in the same community divided by a given algorithm. X is the cardinality of X. The balanced PWF is the harmonic mean of precision and recall. It is defined as follows:(16)PWF=2×precision×recallprecision×recall,whereprecision=LS∩LT/LS and recall=LS∩LT/LT. The higher the PWF, the closer the division is to the ground-truth.


### 4.3. Experimental Results and Analysis

In this section, to validate the effectiveness of GCDNMF for community detection, in addition to comparing with structure based nonnegtive matrix factorization methods, such as stdNMF, ANMF, and Mtrinmf, we also compare with the state-of-the-art NMF-based methods that combines structure and attribute, like CDCN and SCI. In addition, we compare GCDNMF with promising attributed clustering method SA-cluster and probabilistic model PCL-DC (focusing on traditional community detection) and GSB (aiming to detect general community detection). What is more, we compare the performance of GCDNMF with different initialization settings, where GCDNMFrand is with random initialization and GCDNMF is with the centrality-based initialization.The average results of ten random trials are shown in Table3. From the table, we notice that GCDNMF perform well on most of the datasets and achieves the best and second-best on all metrics, ACC, NMI, and PWF. Furthermore, we have the following observations.Table 3
Average comparison results of different methods, the best results are highlighted bold, and the second best are highlighted underline.
MetricAlgorithmCoraCiteseerCornellTexasWisconsinWashingtonACCstdNMF0.3350.2500.3380.4550.3860.433ANMF0.3810.2630.3240.4230.3220.374CDCN0.2770.2170.4220.3950.3750.500Mtrinmf0.2290.2160.2700.2860.2830.272SCI0.3440.2630.4560.5650.5440.525SA-cluster0.2330.2640.4150.4010.4040.491GSB0.3350.2840.4560.5970.5360.366PCL-DC0.5640.4120.3290.3480.3360.380GCDNMFrand0.4340.2330.3780.4940.3880.457GCDNMF0.4780.3430.4920.6300.4760.585NMIstdNMF0.1860.0500.0870.1240.0750.113ANMF0.2450.0660.1050.1650.0690.103CDCN0.0470.0580.1150.0790.0840.105Mtrinmf0.0430.0120.0460.0420.0370.029SCI0.1450.1160.0790.0800.1690.139SA-cluster0.0470.1170.0640.0820.1010.077GSB0.2070.0850.1220.2650.1570.068PCL-DC0.4160.1700.0730.0610.0600.092GCDNMFrand0.2870.0370.1080.1820.0810.130GCDNMF0.3690.1510.1470.2200.0650.162PWFstdNMF0.2570.2110.3090.4350.3250.397ANMF0.3590.2510.2830.3910.2880.327CDCN0.2240.2710.3760.3810.3690.490Mtrinmf0.1800.1780.2400.2700.2560.250SCI0.3000.2920.4370.5450.5070.503SA-cluster0.2330.2640.4150.4010.4040.491GSB0.2580.2320.4020.5700.5070.296PCL-DC0.4410.2990.2810.3160.2740.326GCDNMFrand0.3720.2220.3310.4780.3450.415GCDNMF0.3850.3000.4520.6110.4070.521Different from the method only considering topology, such as Mtrinmf, stdNMF, and ANMF, the method of integrating topological connections and node attributes can significantly improve the performance of community detection. The best and second-best results are obtained by methods that integrate two types of information. For instance, the highest ACC score among the methods that focus on network topology information is 0.455(stdNMF), and the best ACC score among the methods that combine both the topology and attribute is 0.565(GSB) on Texas dataset. Compared with those methods, our method GCDNMF achieves 0.630.Among all the comparison methods of structure and attribute fusion, PCL-DC achieves the best results and GCDNMF is second on Cora and Citeseer datasets. This is in accordance with the original intention of PCL-DC, which is mainly used for mining traditional community structures. But on the other four datasets with mixture community structures, methods based on joint matrix decomposition (such as GCDNMF and SCI) and statistical inference model GSB have better performance. Specifically, compared with PCL-DC, GCDNMF improve ACC and PWF by almost20% on Washington dataset. For the general community structure discovery, i.e., on the WebKB datasets (including Cornell, Texas, Wisconsin and Washington), overall, GCDNMF and GSB have comparable effects, but GCDNMF achieves the best on three of the four datasets in terms of ACC and PWF. In addition, GCDNMF is able to extract traditional community structures better than GSB, such as on the Cora and Citeseer datasets. This observation implies that GCDNMF can capture more complex community structures, which is shown in that it can not only discover traditional community structures, but also detect mixture structures in networks. This verifies the effectiveness of our proposed GCDNMF by introducing consistency constraints to explore the community-interaction between linkages and attributes.


### 4.4. Convergence and Stability Study

To solve the proposed joint formulation, we adopt an iterative update technique. In this subsection, we experimentally study the convergence of our proposed GCDNMF. The convergence rate on six datasets are shown in Figure2. From these figures, we can see that our proposed GCDNMF converge within 50 iterations on all datasets.Figure 2
Convergence curve of our proposed GCDNMF. The horizontal axis is the number of iterations, and the vertical axis is the difference of the objective function values. The value of the vertical axis gradually decreases to close to 0, indicating that the algorithm converges.
(a)
Cora(b)
Citeseer(c)
Cornell(d)
Texas(e)
Washington(f)
WisconsinFurther, we experimentally validate the effectiveness of the initialization strategy in our work, and we compare the performance of GCDNMF with random initialization. Due to limited space, we take the Citeseer and Texas networks as examples to test the results of GCDNMF with and without initialization. As shown in Figure3, the blue, red, and green lines, respectively, reflect the results of ACC, NMI, and PWF in ten iterations. The solid line is the results of using initialization, and the dotted line is the result of without initialization. From the figures, it can be noted that the initialization mechanism significantly improves the stability of the results. More specifically, the standard deviation of ten-round results is 0.0006, 0.0002, and 1.07E-4, respectively, in these three metrics with initialization strategy, while the standard deviation without initialization strategy is 0.025, 0.021, and 0.314. Additionally, we find that the accuracy of network community detection is significantly improved through the initialization strategy. Similarly, the same conclusion can be obtained on other networks. In conclusion, the experimental results show that GCDNMF can converge quickly while maintaining high community detection quality compared to random initialization.Figure 3
Results of GCDNMF with and without initialization on Citeseer and Texas datasets. The blue, red, and green lines represent the ACC, NMI, and PWF, respectively, where the solid line is the result with our introduced initialization, and the dashed line is the result with random initialization.
(a)
Citeseer(b)
Texas


### 4.5. Parameters Analysis

The GCDNMF model has two hyperparameters:α indicates the contribution of the attribute information to the community detection results, and β controls the strength of consistency between community-relation matrices derived from structure and attribute. Because the results of different networks have similar tends, here we demonstrate and analyze the performance effect of hyper-parameters on Texas in experiments. We vary α and β in range of 0.01,0.1,1,10,⋯,100 and observe the results while holding the other parameter fixed. Figures 4(a) and 4(b) demonstrate the performance of GCDNMF when α=1 and β=1 and ranging the other parameter from 0.01 to 100, respectively. From the figures, we observe that GCDNMF is sensitive to β and is relatively stable with different settings of α when β fixed. Specifically, from Figure 4(a), when β becomes larger, the performance of GCDNMF first keeps rising slightly and then drops sharply at a certain value. This indicates that too large β will introduce noise by excessive consistency constraint from attribute clusters. Therefore we suggest α to be 1 (with equal attention to structure and attribute information) and properly tune β in 0.01,0.1,⋯,50 so as to achieve a high performance.Figure 4
The effect of parameterβ and α.
(a)
β(b)
α


## 4.1. Data Description

We used both synthetic and real-world networks to test the effectiveness of our proposed algorithm. The details of these datasets are given below, and the detailed parameters of the data are given in Table2.
(1)
Cora the Cora dataset is a subset of the large Cora citation dataset. It contains 2708 research papers from seven subfields of machine learning. In this network, each node is characterized by a 0/1-valued word vector indicating the absence/presence of the corresponding word from the dictionary, which consists of 1703 unique words.(2)
Citeseer the Citeseer dataset is a citation network of computer science publications. It contains 3312 publications, each of which is labeled as one of 6 categories. Similar to Cora dataset, each publication is described as one binary vector indicating the presence or absence of the corresponding word from a dictionary of 3703 unique words.(3)
WebKB the WebKB dataset consists of 877 scientific publications and 1608 links, which includes Web page networks of four universities: Cornell, Texas, Washington, and Wisconsin.Table 2
Details of the real-world network datasets utilized in the experiments, whereN, E, M, and K are the number of nodes, edges, attributes, and communities, respectively, where ‘AVD’, ‘CC’, and ‘ASC’ represent the average degree, clustering coefficient, and assortative coefficient.
NetworksNEMK‘AVD’‘CC’‘ASC’Cora27085429143373.890.241-0.065Citeseer33124732370362.730.1420.047Cornell195304170352.900.157-0.241Texas187328170353.090.303-0.250Wisconsin265530170353.180.278-0.179Washington230446170353.540.197-0.223According to the block matrices of the networks, the first two datasets are assortative mixing(traditional community structure) as shown in Figure1(a) taking the Cora dataset as example, while the WebKB datasets is mixture structure, which is neither assortative mixing nor disassortative mixing(e.g.,bipartite structure or multipartitie structure) show in Figure 1(b) taking the Washington dataset as example.Figure 1
The gray-scale images of community-relation matrices, namely, the block matrices of the networks. Each block represents the link probabilities between the corresponding community pair, and darker colors of the blocks correspond to larger link probability.
(a)
Cora(b)
Washington


## 4.2. Evaluation Measurements

In this study, three commonly used metrics are used to measure the performance of an algorithm, accuracy (ACC) [39], normalized mutual information (NMI) [39], and Pairwise F-measure (PWF) [40]. These metrics are defined as follows.
(1)
Accuracy (ACC). Given nodei, lpi is the assigned label by an algorithm, and lti is the true label. The accuracy is defined as the fraction of all nodes whose predicted labels are the same with the true labels. The ACC of a particular division of a network is defined as follows:(14)ACC=∑i=1nδlti,pmaplpin,where δx,y is a Kronecker function that the value is 1 if x=y, otherwise, 0. pmaplpi is a permutation mapping function that maps the label lpi of node i to the corresponding label in the ground-truth. n is the overall number of nodes in a network.
(2)
Normalized mutual information (NMI). The NMI is defined by:(15)NMIC,C′=−2∑i=1K∑j=1K′nijlognijn/niCnjC′∑i=1KniClogniC/n+∑j=1K′njC′lognjC′/n,where C is the ground-truth cluster label, C′ is the computed cluster label, K is the number of communities, niC is the number of nodes in the ground-truth community i, njC′ is the number of nodes in the computed community j, nij is the number of nodes in the ground-truth community i that are assigned to the computed community j. In general, the higher NMI, the better result an algorithm get.
(3)
PairwiseF-measure (PWF). Let LT denote the set of nodes having the same community label in the ground-truth, and LS be the set of nodes in the same community divided by a given algorithm. X is the cardinality of X. The balanced PWF is the harmonic mean of precision and recall. It is defined as follows:(16)PWF=2×precision×recallprecision×recall,whereprecision=LS∩LT/LS and recall=LS∩LT/LT. The higher the PWF, the closer the division is to the ground-truth.


## 4.3. Experimental Results and Analysis

In this section, to validate the effectiveness of GCDNMF for community detection, in addition to comparing with structure based nonnegtive matrix factorization methods, such as stdNMF, ANMF, and Mtrinmf, we also compare with the state-of-the-art NMF-based methods that combines structure and attribute, like CDCN and SCI. In addition, we compare GCDNMF with promising attributed clustering method SA-cluster and probabilistic model PCL-DC (focusing on traditional community detection) and GSB (aiming to detect general community detection). What is more, we compare the performance of GCDNMF with different initialization settings, where GCDNMFrand is with random initialization and GCDNMF is with the centrality-based initialization.The average results of ten random trials are shown in Table3. From the table, we notice that GCDNMF perform well on most of the datasets and achieves the best and second-best on all metrics, ACC, NMI, and PWF. Furthermore, we have the following observations.Table 3
Average comparison results of different methods, the best results are highlighted bold, and the second best are highlighted underline.
MetricAlgorithmCoraCiteseerCornellTexasWisconsinWashingtonACCstdNMF0.3350.2500.3380.4550.3860.433ANMF0.3810.2630.3240.4230.3220.374CDCN0.2770.2170.4220.3950.3750.500Mtrinmf0.2290.2160.2700.2860.2830.272SCI0.3440.2630.4560.5650.5440.525SA-cluster0.2330.2640.4150.4010.4040.491GSB0.3350.2840.4560.5970.5360.366PCL-DC0.5640.4120.3290.3480.3360.380GCDNMFrand0.4340.2330.3780.4940.3880.457GCDNMF0.4780.3430.4920.6300.4760.585NMIstdNMF0.1860.0500.0870.1240.0750.113ANMF0.2450.0660.1050.1650.0690.103CDCN0.0470.0580.1150.0790.0840.105Mtrinmf0.0430.0120.0460.0420.0370.029SCI0.1450.1160.0790.0800.1690.139SA-cluster0.0470.1170.0640.0820.1010.077GSB0.2070.0850.1220.2650.1570.068PCL-DC0.4160.1700.0730.0610.0600.092GCDNMFrand0.2870.0370.1080.1820.0810.130GCDNMF0.3690.1510.1470.2200.0650.162PWFstdNMF0.2570.2110.3090.4350.3250.397ANMF0.3590.2510.2830.3910.2880.327CDCN0.2240.2710.3760.3810.3690.490Mtrinmf0.1800.1780.2400.2700.2560.250SCI0.3000.2920.4370.5450.5070.503SA-cluster0.2330.2640.4150.4010.4040.491GSB0.2580.2320.4020.5700.5070.296PCL-DC0.4410.2990.2810.3160.2740.326GCDNMFrand0.3720.2220.3310.4780.3450.415GCDNMF0.3850.3000.4520.6110.4070.521Different from the method only considering topology, such as Mtrinmf, stdNMF, and ANMF, the method of integrating topological connections and node attributes can significantly improve the performance of community detection. The best and second-best results are obtained by methods that integrate two types of information. For instance, the highest ACC score among the methods that focus on network topology information is 0.455(stdNMF), and the best ACC score among the methods that combine both the topology and attribute is 0.565(GSB) on Texas dataset. Compared with those methods, our method GCDNMF achieves 0.630.Among all the comparison methods of structure and attribute fusion, PCL-DC achieves the best results and GCDNMF is second on Cora and Citeseer datasets. This is in accordance with the original intention of PCL-DC, which is mainly used for mining traditional community structures. But on the other four datasets with mixture community structures, methods based on joint matrix decomposition (such as GCDNMF and SCI) and statistical inference model GSB have better performance. Specifically, compared with PCL-DC, GCDNMF improve ACC and PWF by almost20% on Washington dataset. For the general community structure discovery, i.e., on the WebKB datasets (including Cornell, Texas, Wisconsin and Washington), overall, GCDNMF and GSB have comparable effects, but GCDNMF achieves the best on three of the four datasets in terms of ACC and PWF. In addition, GCDNMF is able to extract traditional community structures better than GSB, such as on the Cora and Citeseer datasets. This observation implies that GCDNMF can capture more complex community structures, which is shown in that it can not only discover traditional community structures, but also detect mixture structures in networks. This verifies the effectiveness of our proposed GCDNMF by introducing consistency constraints to explore the community-interaction between linkages and attributes.


## 4.4. Convergence and Stability Study

To solve the proposed joint formulation, we adopt an iterative update technique. In this subsection, we experimentally study the convergence of our proposed GCDNMF. The convergence rate on six datasets are shown in Figure2. From these figures, we can see that our proposed GCDNMF converge within 50 iterations on all datasets.Figure 2
Convergence curve of our proposed GCDNMF. The horizontal axis is the number of iterations, and the vertical axis is the difference of the objective function values. The value of the vertical axis gradually decreases to close to 0, indicating that the algorithm converges.
(a)
Cora(b)
Citeseer(c)
Cornell(d)
Texas(e)
Washington(f)
WisconsinFurther, we experimentally validate the effectiveness of the initialization strategy in our work, and we compare the performance of GCDNMF with random initialization. Due to limited space, we take the Citeseer and Texas networks as examples to test the results of GCDNMF with and without initialization. As shown in Figure3, the blue, red, and green lines, respectively, reflect the results of ACC, NMI, and PWF in ten iterations. The solid line is the results of using initialization, and the dotted line is the result of without initialization. From the figures, it can be noted that the initialization mechanism significantly improves the stability of the results. More specifically, the standard deviation of ten-round results is 0.0006, 0.0002, and 1.07E-4, respectively, in these three metrics with initialization strategy, while the standard deviation without initialization strategy is 0.025, 0.021, and 0.314. Additionally, we find that the accuracy of network community detection is significantly improved through the initialization strategy. Similarly, the same conclusion can be obtained on other networks. In conclusion, the experimental results show that GCDNMF can converge quickly while maintaining high community detection quality compared to random initialization.Figure 3
Results of GCDNMF with and without initialization on Citeseer and Texas datasets. The blue, red, and green lines represent the ACC, NMI, and PWF, respectively, where the solid line is the result with our introduced initialization, and the dashed line is the result with random initialization.
(a)
Citeseer(b)
Texas


## 4.5. Parameters Analysis

The GCDNMF model has two hyperparameters:α indicates the contribution of the attribute information to the community detection results, and β controls the strength of consistency between community-relation matrices derived from structure and attribute. Because the results of different networks have similar tends, here we demonstrate and analyze the performance effect of hyper-parameters on Texas in experiments. We vary α and β in range of 0.01,0.1,1,10,⋯,100 and observe the results while holding the other parameter fixed. Figures 4(a) and 4(b) demonstrate the performance of GCDNMF when α=1 and β=1 and ranging the other parameter from 0.01 to 100, respectively. From the figures, we observe that GCDNMF is sensitive to β and is relatively stable with different settings of α when β fixed. Specifically, from Figure 4(a), when β becomes larger, the performance of GCDNMF first keeps rising slightly and then drops sharply at a certain value. This indicates that too large β will introduce noise by excessive consistency constraint from attribute clusters. Therefore we suggest α to be 1 (with equal attention to structure and attribute information) and properly tune β in 0.01,0.1,⋯,50 so as to achieve a high performance.Figure 4
The effect of parameterβ and α.
(a)
β(b)
α


## 5. Summary

In this paper, GCDNMF is proposed for general attribute network community detection by exploring the consistency relationship between node-community structures based on structural connectivity and node attributes. By comparing with several state-of-the-art methods, it is demonstrated that the GCDNMF method has better performance in revealing the general community structure for all benchmarks. In addition, we demonstrate that GCDNMF has stable performance after adopting initialization. However, there is still space for improvements in future work. Interesting issues include the proposed approach to overlapping community detection and semisupervised general community detection.



---

*Source: 8236157-2022-11-14.xml*