You are on page 1of 13

Journal of Ambient Intelligence and Humanized Computing (2019) 10:175–186

https://doi.org/10.1007/s12652-017-0630-1

ORIGINAL RESEARCH

Sparse network embedding for community detection and sign


prediction in signed social networks
Baofang Hu1,2,3 · Hong Wang1,3 · Xiaomei Yu1,3 · Weihua Yuan1,3 · Tianwen He1,3

Received: 28 July 2017 / Accepted: 14 November 2017 / Published online: 27 November 2017
© Springer-Verlag GmbH Germany, part of Springer Nature 2017

Abstract
Network embedding is an important pre-process for analysing large scale information networks. Several network embedding
algorithms have been proposed for unsigned social networks. However, these methods cannot be simply migrate to signed
social networks which have both positive and negative relationships. In this paper, we present our signed social network
embedding model which is based on the word embedding model. To deal with two kinds of links, we define two relation-
ships: neighbour relationship and common neighbour relationship, as well as design a bias random walk procedure. In order
to further improve interpretation of the representation vectors, the follow-proximally-regularized-leader online learning
algorithm is introduced to the traditional word embedding framework to acquire sparse representations. Extensive experi-
ments were carried out to compare our algorithm with three state-of-the-art methods for community detection and sign
prediction tasks. The experimental results demonstrate that our algorithm performs better than the comparison algorithms
on most signed social networks.

Keywords Signed social network · Network embedding · Word embedding · Sparse representation · Follow-proximally-
regularized-leader

1 Introduction in EBay and Amazon, and likes in YouTube). Voting plays a


critical role to help visitors in the judgement of what is trust-
In recent years, social networks have developed rapidly and worthy (Andrade et al. 2012; Zhang and Liu 2015). These
most of them have voting features (e.g., comments in Slash- networks can be modelled as signed social networks which
dot news review site, voting in Wikipedia, product reviews contain trust and distrust relationships. These relationships
can be useful in various tasks, such as recommendations,
clustering and attitude prediction and have been applied in
* Hong Wang
wanghong106@163.com many other fields (Luo and Liu 2014; Li et al. 2014, 2015a,
b, Li 2018; Zheng et al. 2015; Yu et al. 2016). Online social
Baofang Hu
hbf0509@126.com networks usually involve millions of nodes and are harder to
store and calculate. So representation learning on social net-
Xiaomei Yu
970231168@qq.com works have attracted increasing attention in both aca-demia
and industry.
Weihua Yuan
156047662@qq.com Motived by the development of deep learning in the NLP
(natural language processing) area (Mikolov et al. 2013; Le
Tianwen He
sdsfhtw@163.com and Mikolov 2014; Levy et al. 2015), many network embed-
ding methods have been proposed (Perozzi et al. 2014; Tang
1
School of Information Science and Engineering, Shandong et al. 2015; Grover and Leskovec 2016; Wang et al. 2016;
Normal University, Jinan 250014, China Liao et al. 2017), and show promising performance for vari-
2
School of Information Technology, Shandong Women’s ous applications. However, most of the embedding methods
University, Jinan 250300, China do not incorporate the sign information of links and can not
3
Shandong Provincial Key Laboratory for Distributed simply migrate to signed social networks. Most recently,
Computer Software Novel Technology, Shandong Normal a few works (Wang et al. 2017; Yuan et al. 2017) which
University, Jinan 250014, China

13
Vol.:(0123456789)

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


176 B. Hu et al.

consider the sign information of links are proposed and per- signed graphs based on the random walk normalized Lapla-
form effectively in different tasks. These works represent cian. However, the time complexity of spectral methods is at
nodes in signed social networks using dense low-dimen- least quadratic to the number of vertices, and very expensive
sional vectors. for networks with millions of nodes.
In this paper, we propose a network embedding method
which can not only capture the sign information of links but 2.2 Network embedding
can also represent nodes using sparse low-dimensional vec-
tors. The major contributions of this paper are as follows: With the boom in deep learning, a remarkable word embed-
ding framework called word2vec is proposed. It is proved
– To define an improved biased random walk procedure to that the embedding vectors derived from the model preserve
acquire nodes sequence which incorporate positive and the syntactic and semantic relations between words under
negative relationships; simple linear operations (Mikolov et al. 2013; Li et al. 2014;
– Add sparse constraint into network embedding and Levy et al. 2015).
innovatively employ the follow-the-proximally-regula- Word embedding conforms well to the representation
rized-leader (FTRL-Proximal) algorithm instead of SGD requirement in large-scale social networks and provides
(stochastic gradient descent) to original word embedding a new concept in the study of social networks. DeepWalk
framework to obtain sparse network embedding. (Perozzi et al. 2014), LINE (Tang et al. 2015), node2vec
– Conduct extensive experiments on signed social networks (Grover and Leskovec 2016) and SDNE (Wang et al. 2015)
to demonstrate the effectiveness of our proposed frame- are proposed respectively. The first three algorithms are
work. based on shallow neural network which are easy to train.
SDNE is based on deep neural network which can keep more
The rest of paper is organized as follows: Sect. 2 gives information. The four works are all designed for unsigned
some related works. Section 3 introduces the theory of social networks. Meanwhile, some works (Liao et al. 2017)
word embedding in the natural language process area and learn the network embedding by means of the node attribute
our proposed model is presented in Sect. 4. Section 5 shows information for specific tasks.
the experimental analysis and conclusions are finally drawn There are two network embedding method based on deep
in Sect. 6. learning (Wang et al. 2017; Yuan et al. 2017) which are
designed for signed social networks. The first (Yuan et al.
2017) adopts the log-bilinear model to combine the edge
2 Related work sign information and acquire the node representations. The
second (Wang et al. 2017) introduces virtual nodes into the
2.1 Sign network analysis signed social network and only considers the nodes whose
2-hop networks are all positive links, that will insert a large
signed social network research has attracted wide attention number of nodes which should be trained. The two are all
(Kunegis et al. 2010; Leskovec et al. 2010a; Chiang et al. based on deep network which are hard to train. The repre-
2013; Zheng and Skillicorn 2015). There are two basic theo- sentation vectors of the aforementioned network embedding
ries in signed social network which are the structure balance algorithms are dense and lack of interpretability.
theory (Heider 1946) and the status theory (Leskovec et al. In this paper, we explore sparse constraints and shallow
2010b). The balance theory is the key assumption which is neural network to signed social network embedding.
widely used to analyse signed social networks.
Community structure detection and sign prediction are
two fundamental tasks in signed social networks and the 3 Word embedding
widely adopted method is the Laplacian spectral method.
Kunegis et al. (2010) extended spectral algorithms to signed Our model is based on the skip-gram with negative-sampling
social networks and proposed a spectral method based on training method (SGNS) in word embedding (Mikolov et al.
the signed Laplacian. They showed that by dividing signed 2013). SGNS model utilizes word-context matrix to predict the
social networks into two groups with the signed Laplase ker- surrounding context of a given word. In the following we give
nel, this was similar to the ratio cut in unsigned social net- a brief review of the word-context matrix and SGNS model.
works. Chiang et al. (2013) gave a definition of social imbal-
ance (MOIs) based on l-cycles in signed social networks and 3.1 Word‑context matrix
proposed a community detecting and sign predicting method
based on spectral Laplacian. Zheng and Skillicorn (2015) Given a training corpus D and word vocabularies V, we can
developed two spectral approaches to model and analyse get word sequences which contain the relationships of each

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


Sparse network embedding for community detection and sign prediction in signed social networks 177

word w ∈ Vw with its surrounding words. The surrounding maximally keeps structure information and sign information
words which fall in the fixed-sized windows centered at w in signed social networks. A biased random walk is executed
are called context words and each context word is denoted on signed social networks based on structure information to
c ∈ Vc. produce nodes sequences which will be the input of the word
#(w, c) is the number of all word-context pairs in a embedding framework. In the embedding process, the SGNS
corpus D. N(w, c) of different (w, c) constitute the word- model and the FTRL-Proximal optimization algorithm are
context matrix and #(w, c) is the cth row and wth column adopted to acquire the objective sparse low-dimensional net-
∑ ∑
of the matrix. #(w) = c #(w, c) , N(c) = w #(w, c) , work embedding vectors. In the following section we intro-
∑ ∑
�D� = w c N(w, c). duce the network structure information in the signed social
networks, biased random walk procedure and optimization
3.2 SGNS model algorithm of our proposed algorithm.

The goal of word embedding is to seek appropriate vec-


tors 𝐰 ∈ Rd and 𝐜 ∈ Rd , where d s the dimension of vec- 4.1 Network structure information in signed social
tors space, to meet some pre-defined criterion. In the SGNS network
model, the pre-defined criteria are to predict context words
for a given central word w. As shown by Levy and Goldberg There are two kinds of network structure information in
(2014), the local objective function for a given pair (w, c) is signed social networks, neighbour and common neighbour
defined in Eq. 1. relationships and these are defined below.
Neighbour relationship Structure balance theory is a rec-
Ls(w, c) = #(w, c)log𝜎sim(𝐰, 𝐜) − kEcN ∼PD log𝜎(−sim(𝐰, 𝐜N )) ognized standard of signed social networks, proposed by
(1) Heider (1946). The possible ways in which triangles on three
The first part in Eq. 1 represents the co-occurrence between individuals can be signed are as shown in Fig. 1. In Heider’s
w and c within a context window. The second part is based theory, T1 and T2 are balanced and T3 and T4 are unbal-
on the negative sampling. Where, k is the number of nega- anced. Davis (1967) extended the theory and proposed weak
tively sampled words and cN is the negative sampled context. structural balance theory, in which T4 is also permissible.
To simplify analysis, PD is set to the empirical unigram dis- In real signed social networks, the triads T2 consisting of
tribution PD (c) = #(c) (Levy and Goldberg 2014). two enemies with a common friend are much more than the
|D|
triads T4 in which three individuals are all enemies to each
𝜎(x) = 1
is the sigmoid function. sim(𝐰, 𝐜) is the distance
1+e−x other. The statistical results of the counts of four kinds of
of the embedding vectors and it can be cosine similarity or triads on three real signed social networks (Slashdot news
any other metrics. review site, Epinions consumer review site and Wikipedia
The global objective function is the summation in the vote site) are shown in Table 1 (Leskovec et al. 2010a).
corpus as shown in Eq. 2. W and C are the word and context From above investigation, we can find an enemy’s enemy
embedding matrix, whose column entries are 𝐰 and 𝐜 respec- is likely to be a friend. Therefore, we can design a biased
tively. The objective function is trained utilizing stochastic random walk in signed social network, in which a walker
gradient updates algorithm. selects the next node in two different ways. Not only a friend
∑ ∑ ∑ ∑
Γ = max w∈V c∈V Ls(w, c) = max w∈V c∈V #(w, c)log𝜎sim(𝐰, 𝐜) − kEcN ∼PD log𝜎(−sim(𝐰, 𝐜N )) (2)
W,C W,C

4 Proposed model but also enemy’s enemy may be selected as the next node.
However, propagation of distrust, unlike trust, is a tricky
We aim at representing nodes in signed social networks issue. Enemy’s enemy is not necessarily a friend, while a
using sparse low-dimensional vectors, which can intuitively
represent some kind of network structure such as commu-
nity structure and neighbour relationships. More formally,
let G = (V, E) , where G is a signed social network, V is
the nodes set of the network, and E is its edges set which
have positive or negative weights. Let f ∶ V → Rd be the
mapping function from nodes to vectors, d is a parameter
specifying the number of dimensions of our vector repre-
sentation. Our goal is to learn the mapping function f which Fig. 1  Undirected signed triads relations (Heider 1946)

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


178 B. Hu et al.

Table 1  Descriptions of three datasets and number of balanced and


unbalanced undirected triads in real signed social networks
Epinions Slashdot Wikipedia

Nodes 131,828 82,144 7118


Edges 840,799 549,202 103,747
− Edges 0.15 0.23 0.21
+ Edges 0.85 0.77 0.79
T1 (+ + +) 11,640,257 12,66,646 555,300 Fig. 2  Illustration of the biased random walk procedure in our algo-
T2 (– +) 94,7855 10,9303 163,328 rithm. The walker now is resting on node s and evaluating its next
node h. Dotted line means negative relations, solid line means posi-
T3 (+ + −) 698,023 115,884 63,425 tive relations. Orange lines with arrow mean the next possible step
T4 (− − −) 89,272 16,272 8479

ti denote the ith node in the path, walking from source node
friend of a friend can be considered trustworthy. So we can- S and t0 = S . Node ti is selected as the next node by the fol-
not select the next hop in the crude way and should utilize lowing probability:
the common neighbour relation mentioned below. { 𝜋vx
| if (v, x) ∈ E
Common neighbour relationship Common neighbour P(ti = x|ti−1 = v ) = Z (4)
0 otherwise
relationships involve two kinds of sets: friend set F(w) and
enemy set E(w). Intuitively, if two individual friend sets have where 𝜋vx is the transition probability between nodes v and
a larger overlap area, they tend to be best friends. Rather, if x, and Z is the normalized constant. Because links have
one’s enemy set which covers a large percent of the area of positive and negative weights, we define a biased random
another individual friend set, the relationship between them walk procedure with two parameters p and q to guide the
will be weak and even negative. It is consistent with the random walker. As shown in Fig. 2, a walker now resides
definition of community in signed social network. There are at the current node s and needs to decide the next node h.
more positive links within the same community and more So it evaluates the transition probability Psh on edges (s, h)
negative links between different communities (Gmez et al. leading from s.
2009). Based on the neighbour relationships in the signed social
Based on common neighbour relationships, we define networks, when the walker steps from node s they can select
a local common relation similarity between node s and its not only its positive neighbours a or b+ but also an enemy of
neighbour node h as following: its enemy (e.g. b′). The choice of b′ as the next node depends
∑ ∑ on the value of ls(s, b� ) in Eq. 3. If ls(s, b� ) > 0 , the walker
ls(s, h) =
r∈F(s)∩F(h)
wsr −
m∈E(s)∩F(h)
wsm (3) choose b′ as the next hop and add an virtual edge (s, b� ) to
E(wsb > 0). Conversely, if ls(s, b� ) < 0, b′ is abandoned and
where F(s) is the friend set of node s while E(s) is the enemy the next node from current node s will be reselect.
set. wij means the weight of the link from i to j. The first part In signed social networks, a walker can select a neigh-
of Eq. 3 is the overlapping degree between friend sets. The bor node guided by the extended transition probability p̃ ik
second part is the overlapping degree between the enemy as following:
set and the friend set.
�wik �
� �
4.2 Biased Random Walk procedure on signed p̃ ik =
∑n
�w � (5)
social networks � ij �
j∈nbs(i) � �
Here we defined a biased random walk procedure based on
neighbour relations and common neighbour relationship as However, k is an enemy of i when wik < 0 . In this case,
shown in 4.1 to acquire nodes sequence. we choose an enemy of k as the next node. We define the
Formally, given a source node S, we denote every ran- unnormalized transition probability 𝜋sh from node s to h as
dom walker walks on the network at a fixed step size l. Let following:

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


Sparse network embedding for community detection and sign prediction in signed social networks 179

⎧p⋅ ∑
wsh
wsh > 0
⎪ �wsh �

K∈nbs(s)
�wsk � �wkh �
𝜋sh = ⎨ q ⋅ ∑
�wsi �
⋅ ∑
�wkj �
wsk < 0andwkh < 0and wsh = 0andls(s, h) > 0 (6)
⎪ i∈nbs(s) j∈negativenbs(k)
⎪0 otherwise

where p and q are adjustable parameters which guide the Given a sequence of gradients gt ∈ Rd , SGD performs the
walker by selecting one of its friends or an enemy of its update:
enemy as the next hop. Wt+1 = Wt − 𝜂t gt (7)
where 𝜂t is a non-increasing learning rate.
4.3 Sparse network embedding The FTRL-Proximal algorithm instead uses the update as
follows:
Traditional SGNS model encodes every word vector into
low-dimensional dense vectors. The reason for this is that the
1� �
t
𝜎 W − Ws �
2
SGNS employs SGD (stochastic gradient descent) as the opti- Wt+1 = arg min(g1∶t ⋅ W +
2 s=1 s � �2 + 𝜆1 ‖W‖1 )
mization strategy and the approximate gradient of SGD used
W
(8)
at each update is very noisy and the value of each entry in the
where 𝜎s is the learning-rate and 𝜎1∶t = 1∕𝜂t . 𝜆1 is the hyper-
vector can be easily moved away from zero by those fluctua-
parameter that controls the degree of regularization.
tions. We need to seek other online optimization algorithms to ∑
If we put Zt−1 = g1∶t−1 − t−1 𝜎 W , at the beginning of
replace the SGD to obtain sparse representation. Fortunately, s=1 s s
round t we update by letting Zt = Zt−1 + gt + ( 𝜂1 − 𝜂 1 )Wt ,
there have been several studies concerning the online optimi- t t−1

zation algorithms that target such l1 - norm objectives (Xiao and solve for wt+1 in closed form on a bases by:
2010; Mcmahan 2011; Wang et al. 2015; Liu et al. 2016). It {
0 if ||zt,i || ≤ 𝜆1
has been proven that the follow-the-proximally-regularized- wt+1,i = (9)
−𝜂t (zt,i − sgn(zt,i )𝜆1 ) otherwise
leader (FTRL-Proximal) model has the characteristic of high
efficiency and stability compared with the other two algo-
rithms. In this paper, we propose to employ FTRL-Proximal
algorithm (Mcmahan 2011) in word2vec framework to pro-
duce the sparse representations.

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


180 B. Hu et al.

4.4 Sparse Node2Vec in signed social networks


Algorithm (sparse‑node2vec‑SN)

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


Sparse network embedding for community detection and sign prediction in signed social networks 181

The pseudocode for Sparse-node2vec-SN is given in Algo- ̄ −1 W . D


L̄ rw = I − D ̄ is the extended degree matrix in signed
rithm 1. In the random walk procedure, to avoid the impact social networks. D ̄ = D+ + D− and W = W + − W − .
of the starting nodes on the final walk sequences, a ran- Normalized signed graph Laplacian Lsns (Zheng and Skil-
dom walker starts, simulated from every node. The select- licorn 2015): Lsns = D ̄ −1 (D+ − D− − W). This algorithm
ing strategy of next node is described in bias random walk penalizes long positive edges and short negative edges.
procedure. Firstly, a neighbour (positive or negative) Vcurr Balanced normalized signed graph Laplacian Lbns (Zheng
of current node is sampled based on the transition pos- and Skillicorn 2015) Lbns = D ̄ −1 (D+ − W).
sibility. Secondly, if a negative neighbour is chosen, one SNE (Yuan et al. 2017) It adopts the log-bilinear model
enemy of the negative neighbour will replace current Vcurr and deep neural network. The algorithm uses the random
and the local similarity ls should be judged. If ls(curr, Vcurr ) walk procedure on the original network. In this procedure, a
is negative, Vcurr should be randomly chosen again. SGNS friend and an enemy have the same possibility to be chosen
framework is still employed and the optimization algorithm as the next node.
is replaced with FTRL algorithm. During every phase of the node2vec-SN For further validating the impact of spar-
algorithm, the random walk simulations and optimization sity on improving the quality of the network embedding, we
using FTRL, is parallelizable. adopt a network embedding algorithm without sparse pro-
cessing, node2vec-SN. In node2vec-SN, the adopted online
4.5 Variants of sparse‑node2vec‑SN learning algorithm is SGD.
The hyper-parameters p, q in sparse-node2vec-SN are
There are two variants of sparse-node2vec-SN as following: learned using 10 − fold cross-validation on 10% labelled
sparse-node2vec When the algorithm is implemented on data with a grid search over p, q ∈ {0.25, 0.5, 1, 2, 4}. For
unsigned social networks, the elements wij in the adjacent all the spectral methods, we adopt the top k eigenvectors as
matrix are positive or zero. In this situation, q can be any the network embedding.
value but make no difference. The algorithm sparse-node-
2vec-SN will degenerate into sparse-node2vec. 5.2 Community detection
sparse-node2vec+ The value of q can be zero and in this
situation the negative links are cast away. The sparse-node- In this part, the proposed sparse-node2vec-SN algorithm
2vec+ is suitable not only for signed social networks but and comparative algorithms are tested on six real-world
also unsigned social networks. When used in unsigned social signed social networks and several synthetic networks. For
networks, it is equivalent to sparse-node2vec. detecting the community structures, we adopt the classical
K-means cluster method as the subsequent process for every
algorithm. In order to estimate the performance of differ-
5 Experiments ent algorithms for community detection, two widely used
metrics, improved modularity in signed networks (SQ) met-
The output of our model is merely a representation form ric (Gmez et al. 2009) and normalized mutual information
of nodes, so it can be the input of any downstream net- (NMI) metric (Wu and Huberman 2004), are adopted. SQ
work analysis task such as community detection and sign can be used to evaluate the community detection quality on
prediction. the real-world signed social networks, because the ground
truth is unknown in most real-world networks. Conversely,
NMI is for synthetic signed social networks in which the
5.1 Experimental setup
ground truth is known. The definitions of SQ and NMI are
as follows:
Our experiments evaluate the vector embedding obtained
through sparse-node2vec-SN on different tasks: community [ ( + + )]
1 ∑∑ wi wj w−i w−j
detection and sign prediction for links. Spectral algorithms SQ = wij − − × 𝛿(Ci , Cj )
2w+ + 2w− i j 2w+ 2w−
are widely-used to represent signed social networks. For
both tasks, we evaluate the performance of our algorithm (10)
∑ ∑
against three quintessential spectral algorithms, a signed where w+i = w+ij , w−i = w−ij , w+ij and w−ij are the positive
j j
social network embedding algorithm based on deep neural ∑
and negative weights of the links. 2w+ = w+i ,
network and a variant of our model, without the sparsity j
process. ∑
2w− = w−i . 𝛿(Ci , Cj ) = 1,when i and j in the same com-
Signed normalized Laplacian L̄ rw (Kunegis et al. 2010): j
This approach is extended from the spectral method.

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


182 B. Hu et al.

munity. 𝛿(Ci , Cj ) = 0 , when i and j in different From Table 3 we can see that, for the SPP and the GGS
communities. networks, all the algorithms can find the best community
Given two community structures A and B in the same net- structure. The two signed social networks are small in size.
work, and then let C be the confusion matrix whose element It is easy for the algorithms to find the optimal solutions.
Cij is the number of common nodes between community i in However, the algorithms based on deep learning some-
structure A and communityj in structure B. times performs worse than the other three spectral meth-
�CN� ods. The reason is that our algorithm is based on word
∑CA ∑CB
−2 i=1 j=1
Cij log ij
embedding technology in which nodes are represented in
Ci. C.j
NMI(A, B) = ∑ � � ∑ � C � (11) at least 16 dimensions space and this is inefficient for very
CA CB
small networks. Figures 3 and 4 show the worst commu-
Ci. .j
i=1
Ci. log N
+ j=1
C.j log N
nity structures obtained by our proposed algorithm when
experimenting on the SPP and the GGS networks.
where N is the number of nodes, CA (CB ) is the number of
For the other four networks, we can observed that the
communities in structure A(B) and Ci .(C. j) is the sum of ele-
maximum values and the averaged values obtained by our
ments of C in row i (column j).
proposed algorithm are higher than those obtained by the
rest of the algorithms, which indicates that the discovered
5.2.1 Testing on real‑world signed social networks
community structures are better than those discovered by
the comparative algorithms. All the experimental results
Six real-world signed social networks have been employed to
demonstrate that the proposed optimization model is effec-
test the community detection performances of the proposed
tive for the signed social network community detection
algorithm and the comparison algorithms. The statistics of
each network are given in Table 2, and only the ground truth
of SPP and GGS are known. Because the networks are all
small, in the experiments, d is set to 16 and each algorithm
has been independently tested for 30 times.

Table 2  Statistics of the signed social networks. E+ and E denote the


positive and negative edges, respectively
Network #Vertex #Edge #E+ #E− Refs.

SPP 10 45 18 27 Heider (1946)


GGS 16 58 29 29 Read (1954)
EGFR 329 779 515 264 Oda et al. (2005)
Macrophage 678 1425 947 478 Oda et al. (2004)
Yeast 690 1080 860 220 Milo et al. (2002)
E. coli 1461 3215 1879 1336 Shen-Orr et al. (2002) Fig. 3  The worst community structures of SPP detecting by our algo-
rithm

Table 3  Statistical results over Index Algorithm SPP GGS EGFR Macrophage Yeast E. coli
30 runs on the signed social
networks SQmax L̄ rw 0.4547 0.4530 0.2753 0.3010 0.5838 0.3696
Lsns 0.4547 0.4530 0.2731 0.2985 0.5879 0.3673
Lbns 0.4547 0.4530 0.2848 0.3028 0.5969 0.3753
SNE 0.4547 0.4530 0.2875 0.3240 0.6036 0.4100
node2vec-SN 0.4547 0.4530 0.2870 0.3236 0.6006 0.4034
sparse-node2vec-SN 0.4547 0.4530 0.2878 0.3244 0.6038 0.4032
SQavg L̄ rw 0.4532 0.4520 0.2678 0.2738 0.5321 0.3652
Lsns 0.454 0.4518 0.2635 0.2787 0.5434 0.3301
Lbns 0.4543 0.4526 0.2791 0.2921 0.5741 0.3631
SNE 0.4539 0.4516 0.2785 0.3164 0.5971 0.3883
node2vec-SN 0.4533 0.4421 0.2764 0.3043 0.5975 0.3864
sparse-node2vec-SN 0.4436 0.4428 0.2835 0.3189 0.5979 0.3908

Best results are highlighted in bold

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


Sparse network embedding for community detection and sign prediction in signed social networks 183

step of 0.1. In the five group experiments, P+ is set to a fixed


value from 0.1 to 0.5. The real community structure in every
network is known and we adopt NMI as evaluation metric.
The experimental results are shown in Fig. 5.
As can be seen, community structures detected by the
algorithms have high similarity to the ground truth when
P− and P+ is both lower than 0.2. When P− and P+ increase,
communities are more ambiguous and harder to be detected.
Therefore, the performance of the four algorithms decreases.
However, we can find that our algorithm performs better
than the other three algorithms on most of networks.
From a much more comprehensive analysis on the five
Fig. 4  The worst community structures of GGS detecting by our groups of experiments, we can observe that all algorithms
algorithm are more sensitive to P− than P+ . In other words, given
P+ , the NMI changes more obviously as the value of P−
increases in the range from 0 to 0.4 compared with the same
Table 4  Parameter settings for the generated synthetic signed social situation of P+. This is because, spectral methods and our
networks sparse-node2vec-SN are all based on the statistical hypoth-
Parameter Value Parameter Value esis that the enemy of one’s enemy is likely to be a friend.
P− is the opposite the assumption. However, the NMI of our
n 1000 10
smin
algorithm decreases more slowly than others. This is due
15 50
davg smax
to the common neighbour relationship which validates the
40 0.7
dmax Pin
assumption in our algorithm.
𝛾 2 P− [0.1:0.1:0.5]
𝛽 1 P+ [0.1:0.1:0.5]
5.3 Sign prediction

5.3.1 Datasets and experimental setting


problem while it seems that the sparsity constraint is indis-
pensable in these representations. We further test our algorithm and comparative algorithms
for sign prediction task on three large-scale signed social
5.2.2 Testing on synthetic signed social networks networks as following. The descriptions of the three net-
works (Leskovec and Krevl 2014) are as shown in Table 1.
Here, several synthetic networks with different proper- Slashdot Slashdot is a news review site, in which users
ties are constructed based on LFR model (Lancichinetti can tag each other as friends or foes. The network contains
et al. 2008). A random signed social network is labelled friend links (positive links) and foe links (negative links)
as SN(n, davg , dmax ,𝛾, 𝛽, smin , smax , Pin , P− , P+ ) , where n is between the users of Slashdot.
the number of nodes, davg and dmax are average degree and Epinions Epinions is an online product review site, in
maximum degree , 𝛾 and respectively are exponents for the which users can provide ratings to items. Users can provide
power law distribution of the node degree and community positive and negative ratings not only to products but also
size, smin and smax are minimum and maximum community to other reviewers.
size. smax is the probability of each node connecting other Wikipedia In Wikipedia, any Wikipedia member may cast
nodes in the same community. When Pin < 0.5, the commu- a supporting or opposing vote to other admin users. Such
nity structures are mixed and hardly detected. P− and P+ are votes can be viewed as positive links and negative links.
two noise parameters to make the networks non-partitionable We adopt the traditional random walk methodology
and unbalanced. P− means the probability of negative edges (only walking through positive links) to select 4000 nodes
existing within communities while P+ represents that of from each dataset and then add negative links between the
positive edges existing between communities. In the follow- selected nodes to construct new connected graphs as data-
ing subsection, we generate artificial signed social networks sets. Each new dataset E is divided into two subsets: (i) train-
with the parameter settings shown in Table 4. ing set ET is regarded as known information and, (ii) test set
We make five group experiments to compare the perfor- EP is used for testing and the signs of links in this set are
mance of our method and the other comparative algorithms labelled. It is obvious that, E = ET ∪ EP and ET ∩ EP = � .
based on different levels of P− and P+. In each group, P+ is We evaluate and compare these algorithms using a tenfold
set to a fixed value and P− is increased from 0.1 to 0.5 in the

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


184 B. Hu et al.

Fig. 5  NMI of SN (1000, 15, 40, 2, 1, 10, 50, 0.7, P− , P+) obtained by different detection algorithms

cross-validation methodology. The sign prediction methods While the top k dimensional eigenvectors contain zero
of the four algorithms are described as follows: entries for links not present in the original graph, the
Sparse-node2vec-SN, node2vec-SN and SNE The sign approximation L̄ (k) is nonzero at these entries, and the sign
prediction of the three algorithms is based on the Cosine of these entries can be used as a prediction for the sign of
similarity of the vector representations. missing links. The value of k is set to 128.
f (u) ⋅ f (v)
Similarity(u, v) = (12) 5.3.2 Experimental results
|f (u)| ⋅ |f (v)|
The resulting similarity ranges from −1 meaning an enemy For measuring the prediction accuracy, we use three kinds
relationship, to 1 meaning a friend relationship, with 0 of accuracy: accuracy of all signs (Accuracy-all), accuracy
indicating no relationship, and in-between values indicat- of positive links (Accuracy+) and accuracy of negative links
ing intermediate similarity or dissimilarity. Here, we set (Accuracy−). The experimental results are shown in Fig. 6.
d = 128, r = 15, l = 80, k = 10. As the results for sign prediction shown in Fig. 6, the
Spectral methods L̄ rw , Lsns , and Lbns To evaluate the general observation that the sparse network embedding in
signed spectral approach, we use three graph kernels based signed social networks performs better than the other algo-
on the signed Laplacian matrix L̄ rw , Lsns , Lbns , and labelled rithms, especially when the overall accuracy is concerned.
them as L.
̄ These kernels are computed with the reduced Accuracy for predicting positive links and negative links
eigenvalue decomposition of L̄ (d) = U ∧ U T only the top varies widely, particularly in the three spectral methods. This
d dimensional eigenvectors are kept. L̄ (k) ≈ U(k) ∧ U(k) T . is because; the ratio of negative links is much lower than

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


Sparse network embedding for community detection and sign prediction in signed social networks 185

Fig. 6  Sign prediction accuracy in three signed social networks

positive links in the three datasets. Meanwhile, the reduc- define a biased random walk procedure based on two rela-
tion and reconstruction operations in spectral methods may tionships defined in this paper. Furthermore, we employ the
lose information and add noise. Our algorithm is based on sparse process into our model to improve the quality and
random walk in which the neighbour relationships are a con- efficiency of the representations. Empirically, we evaluated
cern. This will ease the information loss. SNE performs best the generated network representations in a variety signed
when predicting the positive links while it performs worse social networks and applications. The results demonstrate
than our algorithm when predicting the negative links, espe- substantial gains of our method compared with state-of-art
cially in Slashdot. The reason for this is that sparse represen- methods currently available.
tation is traditionally viewed as a typical denoising method. In spite of the overall higher performance of our algo-
The sparse process in our algorithm can decrease the differ- rithm, our algorithm is still more sensitive to negative noisy
ence between predicting positive links and negative links. information than positive noisy information. In our future
work, more efforts will be made to reduce this kind of sen-
sitivity in community detection and sign prediction of signed
6 Discussion and conclusion social network.

Positive and negative links in signed social networks give Acknowledgements This work is partly funded by the National Nature
Science Foundation of China (nos. 61672329, 61373149, 61472233,
us more information about the users, which is very impor- 61572300, and 81273704), Shandong Provincial Project for Science
tant for recommendations and prediction tasks. The scale and Technology Development (no. 2014GGX101026), Shandong Pro-
of these complex networks is usually high. In this paper, vincial Project of Education Scientific Plan (no. ZK1437B010), Tais-
we design a signed social network embedding model based han Scholar Program of Shandong Province (nos. TSHW201502038
and 20110819), and Shandong Provincial Project of Exquisite Course
on the word embedding model. To obtain the corpus, we (nos. 2012BK294, 2013BK399, and 2013BK402).

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


186 B. Hu et al.

References Luo C, Liu H (2014) Controllability of boolean control networks under


asynchronous stochastic update with time delay. J Vib Control.
https://doi.org/10.1177/1077546314528022
Andrade N, Andrade N, Pouwelse J, Sips H (2012) Leveraging trust
Mcmahan HB (2011) Follow-the-regularized-leader and mirror
and distrust for sybil-tolerant voting in online social media. The
descent: equivalence theorems and l1 regularization. J Mach
workshop on privacy and security in online social media (pp. 1).
Learn Res Proc Track 15: 525–533
ACM. https://doi.org/10.1145/2185354.2185355
Mikolov T, Sutskever I, Chen K, Corrado G, Dean J (2013) Distributed
Chiang KY, Hsieh CJ, Natarajan N, Dhillon IS, Tewari A (2013) Pre-
representations of words and phrases and their compositionality.
diction and clustering in signed networks: a local to global per-
Adv Neural Inf Process Syst 26:3111–3119 arXiv:1310.4546
spective. J Mach Learn Res 15(1):1177–1213 arXiv:1302.5145
Milo R, Shen-Orr S, Itzkovitz S, Kashtan N, Chklovskii D, Alon U
Davis JA (1967) Clustering and structural balance in graphs. Hum Relat
(2002) Network motifs: simple building blocks of complex net-
20(2):181–187. https://doi.org/10.1177/001872676702000206
works. Science 298(5594):824–827. https://doi.org/10.1126/
Gmez S, Jensen P, Arenas A (2009) Analysis of community structure in
science.298.5594.824
networks of correlated data. Phys Rev E Stat Nonlinear Soft Matter
Oda K, Kimura T, Matsuoka Y, Funahashi A, Muramatsu M, Kitano H
Phys 80(2):016114. https://doi.org/10.1103/PhysRevE. 80.016114
(2004) Molecular interaction map of a macrophage. In: Proceed-
Grover A, Leskovec J (2016) node2vec: Scalable Feature Learning
ings of JSPE semestrial meeting the Japan society for precision
for Networks: KDD. In: Proceedings international conference on
engineering, 2004, pp 417
knowledge discovery and data mining, 2016, pp 855–864. https://
Oda K, Matsuoka Y, Funahashi A, Kitano H (2005) A comprehensive
doi.org/10.1145/2939 672.2939754
pathway map of epidermal growth factor receptor signaling. Mol
Heider F (1946) Attitudes and cognitive organization. J Psychol
Syst Biol. https://doi.org/10.1038/msb4100014
21(1):107. https://doi.org/10.1080/00223980.1946.9917275
Perozzi B, Al-Rfou R, Skiena S (2014) DeepWalk: online learning of
Kunegis J, Schmidt S, Lommatzsch A, Lerner J, Luca EWD, Albay-
social representations. In: ACM SIG-KDD international confer-
rak S (2010) Spectral analysis of signed graphs for clustering,
ence on knowledge discovery and data mining, 2014, pp 701.
prediction and visualization. In: Proceedings of the SIAM inter-
https://doi.org/10.1145/ 2623330.2623732
national conference on data mining, 2010, pp 559. https://doi.
Read KE (1954) Cultures of the central highlands, new guinea.
org/10.1137/1.9781611972801.49
Southwestern J Anthropol 10(1):1–43. https://doi.org/10.1086/
Lancichinetti A, Fortunato S, Radicchi F (2008) Benchmark graphs for
soutjanth.10.1.3629074
testing community detection algorithms. Phys Rev E Stat Non-
Shen-Orr SS, Milo R, Mangan S, Alon U (2002) Network motifs in the
linear Soft Matter Phys 78(2):046110. https://doi.org/10.1103/
transcriptional regulation network of Escherichia coli. Nat Genet
PhysRevE.78.046110
31(1):64–68. https://doi.org/10.1038/ng881
Le QV, Mikolov T (2014) Distributed representations of sentences and
Tang J, Qu M, Wang M, Zhang M, Yan J, Mei Q (2015) LINE: large-
documents. Comput Sci 4:1188–1196 arXiv:1405.4053
scale information network embedding. Int Conf World Wide Web
Leskovec J, Huttenlocher D, Kleinberg J (2010) Signed networks in
2015:1067–1077. https://doi.org/10.1145/2736277.274 1093
social media. Sigchi Conf Hum Factors Comput Syst 2010:1361–
Wang D, Cui P, Zhu W (2016) Structural deep network embedding.
1370 arXiv:1003.2424
In: The ACM SIGKDD international conference, 2016, pp 1225–
Leskovec J, Huttenlocher D, Kleinberg J (2010) Predicting positive
1234. https://doi.org/10.1145/ 2939672.2939753
and negative links in online social networks. Int Conf World Wide
Wang J, Gong B, Liu H, Li S (2015) Model and algorithm for
Web 2010:641–650 arXiv:1003.2429
heterogeneous scheduling integrated with energy-effi-
Leskovec J, Krevl A (2014) SNAP datasets: stanford large network
ciency awareness. Trans Inst Meas Control. https://doi.
dataset collection. urlhttp://snap.stan-ford.edu/data. Accessed 26
org/10.1177/0142331215583324
Jun 2014
Wang S, Tang J, Aggarwal C, Chang Y, Liu H (2017) Signed network
Levy O, Goldberg Y (2014) Neural word embedding as implicit matrix
embedding in social media. In: The SIAM international confer-
factorization. Adv Neural Inf Process Syst 3:2177–2185
ence on data mining, pp 327–335
Levy O, Goldberg Y, Dagan I (2015) Improving distributional simi-
Wu F, Huberman BA (2004) Finding communities in linear time:
larity with lessons learned from word embeddings. Bulletin
a physics approach. Eur Phys J B 38(2):331–338. https://doi.
De La Socit Botanique De France 75(3):552–555. https://doi.
org/10.1140/ epjb/e2004-00125-x
org/10.1080/00378941. 1928.10836296
Xiao L (2010) Dual averaging methods for regularized stochastic learn-
Li J, Liu Z, Chen X, Xhafa F, Tan X, Wong DS (2014) L-encdb: a light-
ing and online optimization. J Mach Learn Res 11(1):2543–2596
weight framework for privacy-preserving data queries in cloud
Yu X, Wang H, Zheng X, Wang Y (2016) Effective algorithms for
computing. Knowl Based Syst 79:18–26. https://doi.org/10.1016/j.
vertical mining probabilistic frequent patterns in uncertain mobile
knosys.2014.04.010
environments. Int J Ad Hoc Ubiquitous Comput 23(3/4):137–151.
Li J, Yan H, Liu Z, Chen X (2015) Location-sharing systems with
https://doi.org/10.1504/IJAHUC.2016.10000377
enhanced privacy in mobile online social networks. IEEE Syst J.
Yuan S, Wu X, Xiang Y (2017) Sne: signed network embedding. In:
https://doi.org/10.1109/JSYST.2015.2415835
Pacific-Asia conference on knowledge discovery and data mining,
Li J, Li J, Chen X, Jia C, Lou W (2015b) Identity-based encryption
2017, pp 183–195. https://doi.org/10.1007/978-3-319-57529-2_15
with outsourced revocation in cloud computing. Comput IEEE
Zhang Z, Liu H (2015) Social recommendation model combining trust
Trans 64(2):425–437. https://doi.org/10.1109/TC.2013.208
propagation and sequential behaviors. Appl Intell 43(3):695–706.
Li J, Zhang Y, Chen X, Xiang Y (2018) Secure attribute-based data
https://doi.org/10.1007/s10489-015-0681-y
sharing for resource-limited users in cloud computing. Comput
Zheng Q, Skillicorn DB (2015) Spectral embedding of signed
Secur 72:1–12. https://doi.org/10.1016/j.cose.2017.08.007
networks. In: Proceedings of the 2015 SIAM international
Liao L, He X, Zhang H, Chua TS (2017) Attributed social network
conference on data mining, 2015, pp 55-63. https://doi.
embedding. arXiv: 1705.04969
org/10.1137/1.9781611974010.7
Liu X, Li S, Zhang K (2016) Optimal control of switching time in
Zheng XW, Lu DJ, Wang XG, Liu H (2015) A cooperative coevolu-
switched stochastic systems with multi-switching times and
tionary biogeography-based optimizer. Appl Intell 43(1):95–111.
different costs. Int J Control. https://doi.org/10.1080/00207
https://doi.org/10.1007/s10489-014-0627-9
179.2016.1214879

13

Content courtesy of Springer Nature, terms of use apply. Rights reserved.


Terms and Conditions
Springer Nature journal content, brought to you courtesy of Springer Nature Customer Service Center GmbH (“Springer Nature”).
Springer Nature supports a reasonable amount of sharing of research papers by authors, subscribers and authorised users (“Users”), for small-
scale personal, non-commercial use provided that all copyright, trade and service marks and other proprietary notices are maintained. By
accessing, sharing, receiving or otherwise using the Springer Nature journal content you agree to these terms of use (“Terms”). For these
purposes, Springer Nature considers academic use (by researchers and students) to be non-commercial.
These Terms are supplementary and will apply in addition to any applicable website terms and conditions, a relevant site licence or a personal
subscription. These Terms will prevail over any conflict or ambiguity with regards to the relevant terms, a site licence or a personal subscription
(to the extent of the conflict or ambiguity only). For Creative Commons-licensed articles, the terms of the Creative Commons license used will
apply.
We collect and use personal data to provide access to the Springer Nature journal content. We may also use these personal data internally within
ResearchGate and Springer Nature and as agreed share it, in an anonymised way, for purposes of tracking, analysis and reporting. We will not
otherwise disclose your personal data outside the ResearchGate or the Springer Nature group of companies unless we have your permission as
detailed in the Privacy Policy.
While Users may use the Springer Nature journal content for small scale, personal non-commercial use, it is important to note that Users may
not:

1. use such content for the purpose of providing other users with access on a regular or large scale basis or as a means to circumvent access
control;
2. use such content where to do so would be considered a criminal or statutory offence in any jurisdiction, or gives rise to civil liability, or is
otherwise unlawful;
3. falsely or misleadingly imply or suggest endorsement, approval , sponsorship, or association unless explicitly agreed to by Springer Nature in
writing;
4. use bots or other automated methods to access the content or redirect messages
5. override any security feature or exclusionary protocol; or
6. share the content in order to create substitute for Springer Nature products or services or a systematic database of Springer Nature journal
content.
In line with the restriction against commercial use, Springer Nature does not permit the creation of a product or service that creates revenue,
royalties, rent or income from our content or its inclusion as part of a paid for service or for other commercial gain. Springer Nature journal
content cannot be used for inter-library loans and librarians may not upload Springer Nature journal content on a large scale into their, or any
other, institutional repository.
These terms of use are reviewed regularly and may be amended at any time. Springer Nature is not obligated to publish any information or
content on this website and may remove it or features or functionality at our sole discretion, at any time with or without notice. Springer Nature
may revoke this licence to you at any time and remove access to any copies of the Springer Nature journal content which have been saved.
To the fullest extent permitted by law, Springer Nature makes no warranties, representations or guarantees to Users, either express or implied
with respect to the Springer nature journal content and all parties disclaim and waive any implied warranties or warranties imposed by law,
including merchantability or fitness for any particular purpose.
Please note that these rights do not automatically extend to content, data or other material published by Springer Nature that may be licensed
from third parties.
If you would like to use or distribute our Springer Nature journal content to a wider audience or on a regular basis or in any other manner not
expressly permitted by these Terms, please contact Springer Nature at

onlineservice@springernature.com

You might also like