A link prediction approach based on deep learning for opportunistic sensor network

Link prediction for opportunistic sensor network has been attracting more and more attention. However, the inherent dynamic nature of opportunistic sensor network makes it a challenging issue to ensure quality of service in opportunistic sensor network. In this article, a novel deep learning framework is proposed to predict links for opportunistic sensor network. The framework stacks the conditional restricted Boltzmann machine which models time series by appending connections from the past time steps. A similarity index based on time parameters is proposed to describe similarities between nodes. Through tuning learning rate layer-adaptively, reconstruction error of restricted Boltzmann machine goes stable rapidly so that the convergence time is shortened. The framework is verified by real data from INFOCOM set and MIT set. The results show that the framework can predict links of opportunistic sensor network effectively.


Introduction
Opportunistic sensor network (OSN) 1 is a new network evolved from the ad hoc network, which is a kind of self-organized network where the communication opportunities between nodes are generated by their movements. The data transmission of the OSN is realized by the store-carry-forward routing mechanism. This new networking mode has irreplaceable advantages in the non-fully connected networks which cannot execute the traditional multi-hop ad hoc networks protocol. Due to the easy development and low cost, OSN is widely applied in many fields such as vehicular ad hoc network, mobile date offloading, 2 information sharing, 3 and mobile computing. 4 With the appearance of critical, multimedia, and real-time applications, quality of service (QoS) 5 in OSN is becoming increasingly significant. Due to link failures, node power failures, or different power management mechanisms, the dynamic topology of OSN makes it hard for underlying networks to ensure data transmission with QoS requirements. The key to solve this problem is capturing the change rule of the network topology and optimizing the routing algorithm through prediction methods. In this article, we propose a novel link prediction model of conditional deep belief network (CDBN) which models time series from the past time steps and a time-based similarity index which can describe the dynamic characteristics of OSN. The link prediction method based on deep learning is proposed to extract the features and study the change rule of the OSN topology, which provides significant support in designing routing algorithm and meets QoS requirements in OSN.

Related work
In recent years, as one of the research directions of data mining, link prediction has been widely studied by scholars in social networks and complex networks. Liu and Wu 6 proposed an optimal probabilistic forwarding protocol to predict links. Zhou et al. 7 studied a new similarity measure which is motivated by the resource allocation process on networks. Links can be simply predicted by this context based on prediction methods except some idealized assumptions which are not suitable for real networks. Liben-Nowell and Kleinberg 8 utilized the similarity between nodes to predict links. Although the node attributes and network structurebased prediction method are efficient for static networks, it is not ideal for the dynamic OSN. By comparing several supervised machine learning algorithms, Al Hasan et al. 9 found that the support vector machine (SVM) has a better performance in link prediction. Brouard et al. 10 presented a new method for semisupervised and transductive link prediction based on Output Kernel Regression, and the method shows that the semi-supervised learning algorithm is shown to be almost identical to the supervised learning algorithm in link prediction problems. The shallow learning algorithm is adopted in machine learning-based link prediction algorithms, which is insufficient in feature extraction for large-scale dynamic OSN.
With the concept of deep learning being put forward, neural network becomes a hot spot in the field of machine learning. 11 Deep learning shows strong ability of learning essential feature of data sets from a few samples by learning a deep nonlinear neural network. 12 In recent years, deep learning has made great achievements in image recognition, 13 speech recognition, 14 natural language processing, 15 information retrieval, and other fields.
In this article, a deep learning based on link prediction model is established at first. Second, a novel similarity index is proposed according to the dynamic characteristics of OSN. Then, we optimize the learning rate of prediction model in order to make it more efficient. Finally, the experimental results show that the proposed link prediction model can predict links in OSN effectively.

Restricted Boltzmann machine
Restricted Boltzmann machine (RBM) 16 is a two-layer neural network model, which is composed of a visible layer and a hidden layer. There are several units among each layer, and the visible units represent the evaluation of objects, while the hidden units represent the state of objects. As it is shown in Figure 1, the hidden layer is h, the weight matrix is w, and the visible layer is v. The units are all connected between layers, while there are no units connected in each layer.
RBM defines (v, h) 2 f0, 1g N v 3 f0, 1g N h as the distribution of the visible layer and the hidden layer. v and h mean that there are N v visible units and N h hidden units. The joint distribution function can be defined as follows where W 2 R N v 3 N h is the weight matrix of layers and a and b are the biases of visible layer and hidden layer, respectively. Due to the non-neurons connected situation in each layer of RBM, the conditional distribution P(hjv) and P(vjh) can be defined as where s is the logistic function, which is defined as In all models based on RBM, the normalized factor Z makes it difficult to solve maximum likelihood value. However, gradient can be evaluated by contrastive divergence algorithm which is proposed by Hinton. 17 This approximate method makes the updating rules of gradient more simple, the parameters of the model are defined as follows where \ Á . data is the expectation of data distribution and \ Á . recon is the distribution of the reconstructed model.

Conditional restricted Boltzmann machine
RBM is a model based on the static data, which is not good at dealing with dynamic and time-varying data. Palmqvist et al. 18 proposed two types of directed connections: autoregressive connections from the past N time steps and connections from the past M configurations of the visible units to the current hidden configuration. The connected weights of these directed connections turn the RBM into a conditional restricted Boltzmann machine (CRBM) (Figure 2).The model solves the problem that the traditional RBM cannot model the time series. M and N are adjustable parameters. In order to facilitate the discussion, we assume N = M and the data at t À 1, ., t À N are concatenated into a history vector which is called v \t . So, if v t is of dimension D, then v t is of dimension N Á D. As shown in Figure 2, the autoregressive parameters are summarized by an N Á D 3 D weight matrix A; the past time series to hidden parameters are summarized by an N Á D 3 H matrix B where H is the number of hidden units.
The states of the hidden units are determined by the input of the current observation and the input of the past time. Given v t and v \t , the hidden units are conditionally independent at time t. Considering the effect of the past input, dynamic biases on each hidden unit and visible unit can be viewed as Then, the conditional distribution of equations (3) and (4) are updated as The contrastive divergence algorithm can also be used in CRBM to update the weight and the static biases where they have the same form as equations (5)-(7) but have a different effect because the states of the hidden units are now inuenced by the previous visible units. The gradients are now summed over all time steps where \ Á . data is an expectation of data distribution and \ Á . recon is the K-step reconstruction distribution as obtained by alternating Gibbs sampling, starting with the visible units clamped to the training data. While learning a CRBM, there is no need to proceed sequentially through the training data sequences. The updates are only conditional on the past N time steps, not the entire sequence. As long as we isolate ''chunks'' of N + 1 frames (the size depending on the order of the directed connections), these small windows can be mixed and formed into mini-batches. To speed up the learning, we assemble these chunks of frames into ''balanced'' mini-batches of size 50.

CDBN
Deep belief network (DBN) is a deep learning neural network composed by multi-layer RBM which is proposed by Hinton. 19 In this article, the link prediction adopted in the OSN uses the same method as mentioned above. Figure 3 shows a CDBN which is stacked by several CRBMs.
The steps to predict links in OSN with CDBN can be summarized as follows: first, multi-layer CRBM is used to extract intrinsic characteristics from the dynamic network according to the meeting records among the snapshots. After training the link prediction model, we connect a softmax classifier to the topmost hidden layer of the CDBN in order to verify the accuracy of the prediction model by test data set. However, there are two problems need to be taken into account: (1) OSN is a dynamic network with frequent changes over time, so the link prediction indexes which applied to social network are not suitable for OSN. So, we need to establish the indexes to describe the dynamic characteristics of OSN. (2) The learning rate is a hot spot in the research of CDBN. If the learning rate is too small, the training time will be too long. On the contrary, it would lead to the instability of the prediction model.

Link prediction index based on time parameter
In social network, Zhou et al. 7 proposed the Local Path (LP) similarity index to predict links. The index takes third-order path into account which is defined as where a is an adjustable parameter, A is the adjacency matrix of the network. (A 3 ) xy is the number of paths between v x and v y , and the path length is 3. All the communication nodes must be considered in OSN but the LP index ignores the one-order path parameter, so the one-order path is added into LP index and it can be defined as In OSN, we assume that there is a node pair (x, y) to be predicted. We can find that link prediction is influenced by the time-related factors due to the dynamics of OSN, which is defined as follows: t 1 : recent contact time with the target node. t 2 : total length of time connected to the target node. f: frequency of contact with the target node.
With the analysis above, the time parameter TP can be defined as It is assumed that the start time of time period T is T 1 and the end time is T 2 . The index of recent contact time is defined as tp 1 = (t 1 À T 1 )=(T 2 À T 1 ). The index of relative contact time is defined as tp 2 = T 2 =(T 2 À T 1 ) and the contact frequency of node pair (x, y) is defined as The weight matrix of time parameter W tp can be calculated by TP. LP similarity index based on time parameter can be obtained by combining equation (18) with W tp , which is defined as By substituting the adjacency matrix of the network with the time parameter matrix, the similarity index of link prediction can be described from structure and time-varying property.

Layer-adaptive learning rate
The selection of learning rate is very important in the process of CRBM training. It tends to empirically choose a smaller learning rate to ensure the stability of the system. In this article, the relation between the gradient of the single layer and the learning rate is taken into account. The gradient of the current layer and the value of the global learning rate determine the value of the current layer learning rate in the same layer. The learning rate t (k) l is defined as follows where t (k) is the global learning rate at the Kth iteration and t (k) l is the adaptive learning rate at the Kth iteration in layer l and it is related to the gradient g (k) l of the current iteration of the current layer.

Experimental data
This section will adopt INFOCOM05 and MIT to carry on the simulation experiment and verify the effectiveness of the CDBN model. The reference information of the two experimental data sets is shown in Table 1 (in CRAWDAD, 20 there are more details about INFOCOM05 and MIT data sets).

Experimental results and analysis
First, in this section, the tradition link prediction index and the LP similarity index based on the time are compared to validate the effectiveness of the similarity index. Then, the CDBN model is constructed to compare with the results of the link prediction with two data sets. The influence of the single-layer adaptive learning rate and the sample dimension on the prediction with the proposed CDBN is analyzed in the final.
In the experiment, the similarity index which proposed by equation (20) is compared with Common Neighbors (CN) index, 21 Adamic-Adar (AA) index, 22 Table 2.
From Table 2, it can be drawn that the time parameter based local path (TLP) similarity index which proposed by equation (20) is more suitable for the prediction of the OSN with dynamic changes than the similarity index which is based on the structure of network.
In the first experiment, the dimension of the training sample in CDBN is set from 50 to 200 (the step length is 25). There are three hidden layer nodes and the number of the neurons in CRBM is 200, 150, and 100.The number of the historical time series is M = N = 6.
In Figure 4, we choose 20 pairs of nodes in MIT data set and INFOCOM data set respectively and the average Accuracy of each node is obtained. Compared with Table 2, it can be obtained from the results that the CDBN can improve the prediction accuracy further on the basis of TLP index.
From Figure 5, when the initial learning rate is 0.01, after 20 iterations of the CRBM, the error of RBM reconstruction under the adaptive learning rate of single layer reaches a relatively stable state. But under the fixed learning rate, the number of iterations of CRBM is nearly 40. Therefore, the adaptive learning rate of the single layer can improve the rate of convergence of CRBM networks when it compares with fixed learning rate. It can also improve the computational efficiency of CDBN.
In the experiment, in order to find the most suitable sample dimension of CDBN, the average accuracy of CDBN in different dimensions of the sample is obtained through calculating the 20 pairs of nodes under two data sets.
From Figure 6, when the sample dimensions are 75 or 100, CDBN will own a better average accuracy under the MIT data set and the INFOCOM data set.
In this experiment, we set the sample dimension to 75 for INFOCOM data set and 100 for MIT data set. The parameters of CDBN are the same as the first experiment. With the optimal parameters, we calculate   the average AUC of 20 pairs of nodes in INFOCOM data set and MIT data set, respectively. From Table 3, it can be seen that the average AUCs of CDBN with different similarity indexes are significantly improved when compared with the static similarity indexes in Table 2.

Conclusion
In this article, a CDBN model based on the deep learning is proposed to achieve the link prediction of OSNs. By combining the CDBN with proposed similarity index, the change law of OSN can be captured accurately while improving the QoS in OSN.
The experimental results show that the links in OSN can be predicted better with the help of our time-based similarity index and the prediction model of CDBN.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.