Community Detection Using Node Attributes and Structural Patterns in Online Social Networks

Community detection in online social networks is a difficult but important phenomenon in term of revealing hidden relationships patterns among people so that we can understand human behaviors in term of social-economics perspectives. Community detection algorithms allow us to discover these types of patterns in online social networks. Identifying and detecting communities are not only of particular importance but also have immediate applications. For this reason, researchers have been intensively investigated to implement efficient algorithms to detect community in recent years. In this paper, we introduce set theory to address the community detection problem considering node attributes and network structural patterns. We also formulate probability theory to detect the overlapping community in online social network. Furthermore, we extend our focus on the comparative analysis on some existing community detection methods, which basically consider node attributes and edge contents for detecting community. We conduct comprehensive analysis on our framework so that we justify the performance of our proposed model. The experimental results show the effectiveness of the proposed approach.


Introduction
Online social media (e.g., Facebook, Twitter) are the platforms where individuals are involved in making relationships with others.Intuitively, these relationships express their social interactions (e.g., friendships, followings, followers) which commonly exhibit the properties of communities structures.Basically, community indicates the groups of individuals with common attributes make a dense connection inside each group and less connection between groups.Generally, in graphical representation, individual and relationship represent nodes and connections between individuals respectively in social networks.Typically, individuals in each social community may have different types of certain interests as such common attributes like as hometown, school mate, living city or common preferences such as photography, movies, music or travel, and hence, they tend to interact more frequently with each other than with users who are outside of their community.
Recently researchers have been interested to detect communities in social networks due to several reasons.One of the main reason is to analyze the human common behaviors.For example, to analyze a product whether it could be preferred by the consumers or not.In such case, we can focus on the communities and easily judge consumers' opinions regarding on this product.However, there are several applications for detecting communities in social networks.Numerous techniques have been developed for detecting community so far.However, most of them consider the node attributes, edge contents or structural patterns of networks for proposing community detection algorithms (Zhou, Cheng, & Yu, 2009) (Qi, Aggarwal, & Huang, 2012, April) (Yang, McAuley, & Leskovec, 2013, December).Indeed these are the possible ways to detect communities in online social networks.With this assumption, we consider node attributes and structural patterns of the networks in together so that our community detection model can exploit these two views in term of detecting communities.With this motivation, we concentrate on the research paper in (Zhou, Cheng, & Yu, 2009) for exploiting tools to detect structural clusters and nodes' attributes clusters.After that, using nodes' clusters and structural clusters, we propose a community detection model that can detect overlapping communities along with distinguished communities based on the set theory and probability (see Section 4).
The contributions of this paper are two-fold.First, we build up an alternative approach that can detect overlapping communities along with distinguished communities, which implies to overcome the limitations in (Zhou, Cheng, & Yu, 2009).Our proposed algorithm that incrementally detects evolving communities in social networks.It delivers significant improvements over the existing solutions in both the quality of detected evolving communities and the speed of program execution.
Second, we generalized the algorithm introduced in (Zhou, Cheng, & Yu, 2009) to incorporate important network features such as node attributes and structural clusters and compare with another method proposed in (Qi, Aggarwal, & Huang, 2012, April).

Related Work
For instance, various existed community detection methods have considered network structures and node attributes in a combined manner to detect communities of individual in online social networks (Yang, McAuley, & Leskovec, 2013, December) (Akoglu, Tong, Meeder, & Faloutsos, 2012, April) (Moser, Ge, & Ester, 2007, August).Unfortunately, these methods cannot detect overlapping communities.Literatures have focused on topic models (Balasubramanyan & Cohen, 2011, April) (Xu, Ke, Wang, Cheng, & Cheng, 2012, May) (Sun, Aggarwal, & Han, 2012), which considered soft node community memberships that allow to detect overlapping communities.However, these methods are not appropriate for modeling communities because they do not allow a node to have high membership strength to multiple communities simultaneously (Yang & Leskovec, 2012) .In paper (Zhou, Cheng, & Yu, 2009), authors have proposed method to cluster a large-scale graph associated with attributes based on both structural and attribute similarities.However, the limitation of their method is that it can not detect the overlapping community.To overcome this situation by considering the same assumption (e.g., structural and attributes similarity) we proposed another way to detect community properly in case of overlapping scenarios.Indeed, there are some novel research works focused to detect overlapping communities in online social network.In paper (Xing, Meng, Zhou, Zhou, & Wang, 2015), authors proposed an overlapping community detection algorithm by considering local community expansion.This algorithm is composed of a three-phase process; in the first phase, it uses the local structural pattern of the social network to find the local communities and extend these communities with larger one according to overlapping score and finally, classifies the nodes, which does belong to any community.An alternative work (Nguyen, Dinh, Nguyen, & Thai, 2011, October) proposed DOCA which classify the nodes into local communities by considering the number of interactions among the nodes and then tries to combine highly overlapped communities if they share significant substructures.Other detection trends include methods based on nodes splitting (Gregory, 2007), modularity (Nicosia, Mangioni, Carchiolo, & Malgeri, 2009) and link-based detection methods (Ahn, 2009).

Motivation
In this paper, we study both nodes' attributes clusters and edge contents clusters to detect online social networks communities and make comparative analysis on these two models.Moreover we also propose an another alternative way to detect overlapping communities which is very simple and straightforward.As (Zhou, Cheng, & Yu, 2009) can not detect overlapping communities, our proposed model can overcome this problem.With this motivation, we describe the node attributes Similarities/Structural model stated in (Zhou, Cheng, & Yu, 2009) that supposes to detect communities in social network by considering the followings.
• Structure-based Clustering/Community. Figure 1b shows clusters obtained from node connectivity, i.e., coauthor relationship.Authors are closely connected within a cluster even if they might have quite different topics, e.g., half work on XML and the other half work on Skyline in one of the clusters.• Attribute-based Clustering/Community. Figure 1c shows another clustering result based on attribute similarity, i.e., topics.Authors within clusters work on the same topics; however, the coauthor relationship may be lost due to the partitioning so that authors are quite isolated in one of the clusters.• Structural/Attribute Clustering/Community. Figure 1d  The above model has some disadvantages as stated below: • This model cannot identify the overlapping communities as shown in Figure 1d.
• It considers an augmented graph where they inserted attribute nodes and added extra edges among the attributed nodes and structural nodes.Therefore, the complexity of this model might be high.• This model does not mention whether the nodes have no attributes then how it produces node attributes cluster.
Our motivation is to overcome these limitations as well as to improve the performance of the communities' detection algorithm.With this motivation, we are going to propose a community detection model for social networks so that our model can detect overlapping communities along with distinguished communities.

Proposed Model
The main aim of this paper is to propose an innovative community detection algorithm.With this intension, we mainly focus on the paper (Zhou, Cheng, & Yu, 2009) proposed SA-cluster method, and envision in different way so that our model can detect

m).
In the first step of our proposed model, we find out the common nodes between structural clusters and nodes' attribute clusters for all combination.For example, structural based clusters as shown in Figure 1b and attribute based clusters as shown in Figure 1c, we proceed on to find out the common nodes for all combinations of structural communities and nodes' attributes clusters using the set theory as below: More particularly, we are looking for the common nodes by exploiting the intersection among all combinations of structural clusters and nodes' attribute clusters.Those nodes are appeared both of structural clusters and nodes' attributes clusters, it means that these are the overlapping nodes involve in communities.
Secondly, for checking the overlapping communities in a given social network, we then exploit the probability theory.For this purpose, we compute the probabilities among all intersections of the combinations of structural clusters and attributes clusters, have been obtained in the first step.More precisely, at first, we progress with two sets of intersections obtained in the first step and consider same the attributes' cluster and different structural clusters.In this case, if a node belongs to both clusters then the probability might be non-zero.It means that the communities are overlapping with each other.Then we consider the next intersection obtained in first step with the previous overlapping communities, take into same consideration and so on until the final intersection.In this way, we can check all possible overlapping communities.Therefore, the probability can be computed as bellow: where, d is (S i ∩ A j ) ∩ (S i+1 ∩ A j ), i is the number of structural communities and j is the number of attribute communities.If the probability is equal to zero, it seems that there is no overlapping nodes, otherwise nodes belongs to overlapping communities.In the final step, we find the communities.For doing so, we consider all combinations of intersections among attribute clusters and structural clusters obtained in the first step and do the same process as do in the second step.But here we consider the union operation among the set of intersections to discover communities.For instance, we have obtained 4 combination of intersections in the first step.Now we make union of these combinations by considering different structural clusters and identical attribute clusters.Thus, we can obtain a community as follow: Similarly, we can detect another community by considering the identical nodes' attribute cluster and diverse structural clusters as given below: ( ∩ ) ∪ ( ∩ ) = { , , , , , , , } If nodes are overlapping with other communities, our model can detect these overlapping communities as explained in the above and the resultant communities are shown in Figure 2.
Lemma 0.1.If n be the number of structural clusters and m be the number of nodes' attributes clusters then the total number of intersections is n×m.Thus (n×m)-1 represents time complexity to find out all overlapping communities.
The proposed Algorithm 1 exhibits the whole idea.First, we consider the structural clusters and nodes' attribute clusters as input to our proposed algorithm, produced by the algorithm in (Zhou, Cheng, & Yu, 2009)

15:
Return: Cn 16: end for than one community and find the probability to check whether the nodes belongs to overlapping communities or not (see line 5 in Algorithm 1).In the next step, if the probability is greater than zero then it produces overlapping communities (see line 10 -11).Finally, it provides the list of nodes Cn which appears in communities (as seen in lines 8, 11 in Algorithm 1).However the time complexity of the proposed Algorithm is O (n×m) where n is the number of structural clusters and m refers to the number of nodes' attribute clusters.

Structural/Attribute Based Community Detection Model
In (Zhou, Cheng, & Yu, 2009), authors stated that structural and attribute similarities are two seemingly independent with each other.So it is difficult to incorporate these two communities in together.However, authors proposed a possible solution by considering distance function between two vertices and define as (Zhou, Cheng, & Yu, 2009): where ( , ) and ( , ) measure the structural distance and attribute distance respectively, while and are the weighting factors.For doing so, authors insert a set of attribute vertices to a graph G.An augmented attributed Graph is shown in figure 3

Edge Content Sharing/Structural Community Detection Model
There is another way to detect online social networks communities by considering both of edge content and structural similarities as shown in Figure 4.In this model (Qi, Aggarwal, & Huang, 2012, April), social network is denoted by the pair = ( , ).The vertex set V contains n nodes { , } and the edge set E contains the m edges { , … .}.Let Γ denotes a × link matrix between edge and vertex set that encodes the link structure.For each edge and vertex , the value of Γ , is set to 1 if is incident to , otherwise Γ , = 0.For detecting structural communities, they consider the edge set is E and latent representation of vertex set is V.Each column of is the latent feature vector for the corresponding vertex.The researchers use the matrix factorization technique to design and such that the matrix product of and approximately represents the link matrix Γ.The optimum values are defined by minimizing the error of the approximation.
* , * = ‖ .− Γ‖ .Δ is a × degree matrix.Replacing the value of V becomes, ( ) = ‖ . .∆ − Γ‖ .For detecting edge content based communities, the researchers assume that the content associated with each edge , is denoted by .They assume that the d-dimensional feature vector to represent the document is denoted by ( ), for notational purposes, they introduce a × matrix to denote these extracted feature vectors.
In this matrix, the th column contains the content feature vector ( ) associated with the edge , consider two edges and , with associated content denoted by and , and corresponding feature vectors denoted by ( )and ( ) respectively.In this case, one can compute the cosine similarity , between the two feature vectors as follows (Qi, Aggarwal, & Huang, 2012, April): The edge content based communities can be detected using the following equation (Qi, Aggarwal, & Huang, 2012, April): So, Edge content/structural based communities detection model is (Qi, Aggarwal, & Huang, 2012, April): Now, in term of comparing Equation 2which is based on node attributes/structural similarities and Equation 5based on edge content/structural similarities is differed only in the second part of the both equations since the first parts of these equations are related with the structural similarities.
In edge content/structural similarities model is indirect process to detect communities because it partitions the edges based on the content.However as we mentioned earlier in Section 3 that whether the nodes have no attributes then how the proposed method (Zhou, Cheng, & Yu, 2009) can proceed on.We believe that if we can merge the both of content/structural similarities and node attributes/structural similarities then we can use the edge contents to set up the value of attributes of nodes.We believe that this could be given more efficient result than others model.Because, It may be happened that every nodes may have no sufficient attributes values and reversely, the content of edge (message) may have no significant value to detect communities.By considering these of types matters into account, we plan to propose another community model in future.

Experimental Results
We carried out several experiments to measure the effectiveness of our proposed method in terms of detecting whether individuals involve in communities or not in online social networks.

Dataset
We use the DBLP (http://dblp.uni-trier.de/xml/)Bibliography dataset for evaluating the performance of our proposed method.We consider 1,000 authors and their coauthor relationships.Moreover, we consider research papers published in DBLP to make communities among authors.For this purpose, we use two relevant attributes namely prolific and primary topic.Authors are labeled as highly prolific if (s)he has 20 papers in DBLP and authors with 10 papers are labeled as low prolific.For attribute "primary topic", we use a topic modeling approach (Zhou, Cheng, & Yu, 2009) to extract 50 research topics from a document collection composed of paper titles from the selected authors.The topic are most representative by considering the probability distribution of keywords.

Metrics
In order to measure the effectiveness of the proposed approach, we make use of conventional measures.In particular, since we have decisions in two categories such as whether the model can detect a node appeared in a community correctly or not.We have 2 labels (i.e., node belongs to community, node does not belongs to community), thus we exploit a 2X2 confusion matrix, see Table 1, representing the adopted notations.More precisely, row of the matrix represents the actual value for a class, column represents a possible measured value, and an element identified by row and column specifies the type of error, if any, in measuring an item whose real value is specified in the row with the label corresponding to the column.

Accuracy
In this experiment, we first check the accuracy of our proposed model in term of varying the number of communities.The obtained result has been shown in Figure 5.According to Figure 5, we show that the accuracy of our proposed model is deteriorated when number of communities increase and after a certain time it seems to be fixed at a level of 75% approximately.Moreover, we make a comparison between SA-cluster proposed in (Zhou, Cheng, & Yu, 2009) and our proposed model as shown in Figure 5.The experiment shows that SA-cluster produces better accuracy than our proposed model when we consider small number of communities.For further analysis, we increase the number of communities which may implies that nodes may have chance to be member of more communities.With this assumption, as depict in Figure 5, we see that the accuracy of SA-cluster going down and our proposed model perform better than SA-cluster since SA-cluster could not able to detect overlapping communities.AS our model consider the overlapping communities thus it produces good accuracy for detecting communities in case of the number of communities are increased.
Figure 5. Accuracy for number of communities Furthermore, we consider non-overlapping and overlapping communities separately and check the accuracy produced by our proposed model.The Figure 6 shows the obtained result that exhibits when we consider only the non-overlapping dataset then the accuracy of our model is better than the overlapping dataset.
Figure 6.Accuracy for non-overlapping and overlapping communities

F1 Score
We measure the F1 score for evaluating the performance of our proposed approach.F1 score considers both the precision and the recall.The precision is the ratio of the number of correctly measured items (i.e.,access requests) to the total number of measured items.Whereas, recall is the ratio of the number of correctly measured items to the total number of relevant items.Our analysis exhibits that our proposed approach works better when the number of communities is in small size and its' performance is degrading when number of communities is increased as shown in Figure 7.The obtained results also show that after a certain period (e.g., when the number of communities is 16) it produces constant accuracy.

Conclusion
In this paper, we have exploited set theory and probability theory in term of detecting online social communities.
More precisely, we have used probability to check whether a node belongs to overlapping communities or not and then we have used set theory to enlist the number of nodes belongs to online social communities.In the future, we plan to define a mechanism that includes strategies on support of improving false positives/false negatives so as we can give more attention on misconfiguration cases.With this direction, we can improve the performance of the proposed algorithm.
Figure 1.Coauthor network example with an attribute "topic"

Figure 2 .
Figure 2. Overlapping communities . An attributed graph is denoted as = ( , , Λ), where is the set of vertices, is the set of edges, and Λ = { , … … .} is the set of m attributes associated with vertices in for describing vertex properties.Each vertex ∈ is associated with an attribute vector [ ( ), … … , ( )] where ( ) is the attribute value of vertex on attribute .Researchers (Zhou, Cheng, & Yu, 2009) denote the size of the vertex set as | | = .Attributed graph clustering is to partition an attributed graph G into k disjoint sub graphs = ( , , Λ), where = ⋃ and ∩ = ∅ for any ≠ .

Figure 4 .
Figure 4.An example of edge content/structural community

Figure
Figure 7. F1 score . Algorithm 1 depicts Cn as the final list of nodes appear in communities.Eventually, our proposed method computes all combinations of intersection Ck among structural clusters and nodes' attributes clusters (see line 2 in Algorithm 1).After then, it computes the intersection among the combinations of Ck for finding any node that appear in more