Algorithm for Determining the Probability of Arrival of an SU to a Base Station in Cognitive Radio Networks

- This document presents the development of an algorithm that predicts the arrival of a secondary user (SU) to a base station (BS) in a cognitive network based on infrastructure, requesting a Best Effort (BE) or Real Time (RT) type of service with a determined bandwidth (BW) implementing neural networks. The algorithm dynamically uses a novel neural network construction technique using the geometric pyramid topology and trains a Multilayer Perceptron Neural Networks (MLPNN) based on the historical arrival of an SU to estimate future applications; This will allow to manage more quickly the information in the BS for the selection of the best channel in CRN as it is placed before the arrival of the SUs. As a final result the software application determines the probability of arrival at a future time point and calculates the performance metrics to measure the effectiveness of the predictions made.


Representation of an SU history
x i , y i is defined as a pair of coordinates in R * , where x i is the binary representation of a time unit in a Space R ; n is the number of digits in the binary representation and y i in a space R , where the first component corresponds to the request or not of a Best Effort type service; The second, the request for a Real Time type service and the third the bandwidth required in KHz. An example of this representation corresponds to the one shown in the following representation (Equation 1): x 1 , y 1 0 0 0 , 0 0 0 This first approximation of representation of SUs with their respective characteristics considers the neural network topology without taking into consideration the nature of the data that are intended to be characterized. Because the transfer functions between each layer of the neural network are given by a sigmoid function, the range of the data is 0 to 1. This is not considered a problem for the data domain that is intended to characterize except for the case of whose third component has domain in the natural numbers (and which corresponds to the bandwidth). In this sense, it is proposed to separate the data set (shown above) into two groups and to use two neural networks. The first network specializes in the characterization of data set , represented as described in Equation 2, and follows the design criteria:  The number of neurons in the input layer corresponds to de .  The number of neurons in the output layer corresponds to the dimension of , each of the neurons will be specialized in modeling a secondary user characteristic.  The number of neurons in the hidden layers is obtained following the geometric pyramid topology.
The second neural network specializes in the characterization of the data set , represented in Equation 3, with the following criteria:  The number of neurons in the input layer corresponds to de .  The number of neurons in the output layer corresponds to the dimension de , each of the neurons will be specialized in modeling a secondary user characteristic.  The number of neurons in the hidden layers is obtained following the geometric pyramid topology. (1)

Mathematical model of the neuronal system
For the development of the operation of the neural network, the set of examples shown in equation 2 is considered. Following the guidelines proposed for the construction of the proposed neural network, we obtain a three-layer system with 3 neurons in the input layer, 2 in the hidden layer and 2 in the output layer, a graphical representation of this neural network is shown in Figure 1. In addition, the following variables are defined: : Number of layers of the neural network; : Control weight matrix, which maps (generates an association) from one layer to one layer + 1; : activation unit in layer . The procedure for calculating the output of the neural network is defined as shown in Equation 4, called forward propagation algorithm. 4 where, is the transposed operation; is the layer output to be calculated; corresponds to the previous layer output; 1, 2, 3, … . , ; ; the sigmoid function.
Considering the control weight matrix , we proceed to calculate the transition from the input layer to the hidden layer (Equations 5 and 6).  Thus, the transition from the input layer to the output layer would be given as described in Equation 7.

7
For simplicity, the following variables are defined for the matrix (Equation 8).

8
When calculating the transition from the hidden layer to the output layer by reference to the control weight matrix (Equation 9 y 10): 9 10

Flowchart for the Learning Algorithm
MLPNN Training Diagram is show in Figure 2.A fragment of the MLPNN code for neural network optimization is shown in Figure 3. It should be noted that the sequence shown implies the existence of two Theta1 and Theta2 arrays corresponding to the average weight matrices of the neural network.

Neural Network Training
During the training process of the neural network, the value of the control weight matrices is determined using the back propagation algorithm which includes the following guidelines within its algorithm:  Randomly initialize the weights of matrices with numbers between -1 and 1.  Implement the forward propagation algorithm to obtain A for any x x i .  Calculating the cost J θ from equation 11, in order to obtain the difference between the expected values and the values obtained, the objective is to have its value approach as close to 0. 1 * * log 1 * log 11  Calculate the partial derivatives of in order to minimize the error to the maximum (equation 12).

Software Implementation
To determine the ability and precision of the MLPNN algorithm to calculate the probability of arrival of the next SU (with BE or RT and BW type QoS criteria) to the BS, a software application was developed in C#. Figure 4 shows the creation phase of the request history for BE, RT and BW (for the figure the past behavior is displayed requesting BE and RT only).     The last phase of the algorithm corresponds to the prediction, which will estimate the future 30% of the historical data and compare them with the actual behavior (Figure 7).

Results evaluation
In order to test the developed proposal, three test cases (from MS Excel) were generated using uniform, Poisson and exponential distributions.     The results found in the prediction suggest that the success percentage is low when predicting the BW to be requested by the SU. It should be noted that this metric evaluates that at any time point the expected value is equal to the value obtained without any margin of error. In this sense, for example, for the exponential distribution (figure 8), it is observed that the neural network identified the pattern, which is why the MSE (which in this case shows the difference between the expected and minimum values) is very small and in the order of hundredths. Another characteristic that can be drawn from the system behavior from the response given to the test cases is that it was possible to identify patterns for the Exponential and Poisson distributions; However, the "Uniform" case, as it did not present a pattern in its historical data, it was not possible to model or predict its behavior. 6. Conclusions. The present paper proposes the development of an algorithm to estimate the probability of arrival of SUs to the central station of a cognitive radio network requesting a BE or RT type service, with a certain BW. The results show that the system is more efficient when the MLPNN can establish a pattern in the historical sequence; Otherwise, the success percentage in the estimation of the next request by an SU may be very low, rendering its implementation unviable because the channels reserved by the base station may not meet the characteristics that cognitive users will actually require.