# Multi-Parametric Analysis of Reliability and Energy Consumption in IoT: A Deep Learning Approach
## 3 System Model
### Deep Learning  
Deep learning is employed for modeling the relationships between communication parameters and performance metrics. The aim is to predict \(PDR\), \(EC_{\text{dense}}\), and \(EC_{\text{sparse}}\) (referred to as target outputs hereafter) based on more than 48,000 combinations of seven pre-configured and three per-packet input variables (referred to as features hereafter). The data is represented in the form of features, and target outputs as: \((f_{m,1},f_{m,2},\ldots,f_{m,10},PDR,EC)\). Here, \(m\) represents the total number of tuples in the data which are 48,384 to be exact. In summary, three deep leaning models are trained for three target outputs with ten input features. For training and evaluating the deep learning models, data are split into training (50%), validation (20%), and test (30%) sets. The following hyper-parameters are tuned for the neural network: the number of dense layers used is 10, the learning rate (\(\alpha\)) is set to 0.001, the maximum number of epochs used is 500 while the training process was stopped if the model did not improve for 150 consecutive iterations. As an exception, for \(EC_{\text{sparse}}\), the number of epochs used is 1500. This is because models kept improving for longer periods due to highly deviant data. It is worth mentioning that the values for all these deep learning parameters (including learning rate, number of layers, and epochs) were chosen empirically. In the following, the computation used for  
Figure 3: \(EC\) in relation to \(PDR\), \(TP\) and \(DT\). Figure 2: Relationship between \(PDR\) and \(EC\). the neural networks consisting of two passes (forward and backward) is described. A forward pass is computed as:  
\[Z^{[l]}=W^{[l]}\cdot A^{[l-1]}+b^{[l]}, \tag{5}\]  
\[A^{[l]}=g^{[l]}(Z^{[l]}), \tag{6}\]  
where \(l\) represents layer number. \(Z,W,b\) and \(A\) represent output vector for the activation function, weights vector used for features, bias/parameter, and the input vector at a layer, respectively. Rectified linear unit is used as the activation function and is represented by \(g\). A backward pass which is responsible for computing rate of change through derivatives with an aim to update weights is calculated as:  
\[dZ^{[l]}=dA^{[l]}\times g^{[l^{\prime}]}(Z^{[l]}), \tag{7}\]  
\[dW^{[l]}=\frac{1}{m}(dZ^{[l]}\cdot A^{[l],T}), \tag{8}\]  
\[db^{[l]}=\frac{1}{m}\sum_{i=1}^{m}Z^{[l]}, \tag{9}\]  
\[dA^{[l-1]}=W^{[l],T}\cdot dZ^{[l]}, \tag{10}\]  
where \(g^{{}^{\prime}}\) represents the derivative of the activation function, and \(m\) is the number of tuples in the training data. Gradient descent algorithm is run with an objective to minimize the error on the validation set updating \(W\) and \(b\) until convergence, using:  
\[W^{[l]}=W^{[l]}-\alpha\times dW^{[l]}, \tag{11}\]  
\[b^{[l]}=b^{[l]}-\alpha\times db^{[l]}. \tag{12}\]  
Model Evaluation  
In order to evaluate the accuracy of deep learning model, the prediction error is calculated as:  
Figure 2:0  
where \(k\) represents the index of a tuple, and \(Y_{k}^{actual}\) and \(Y_{k}^{predicted}\) represent actual and predicted values for \(k^{th}\) tuple in training data. This \(err_{k}\) is used to compute the overall Root Mean Squared Error (\(RMSE\)), Mean Percentage Error (\(MPE\)), and Mean Absolute Percentage Error (\(MAPE\)):  
Figure 2:1  
Figure 2:2  
Figure 2:3  
where \(m_{t}\) represent the number of examples in the test data. The \(RMSE\) computes the sum of the squares of differences of prediction errors on all data points divided by the number of samples, and their square root is taken to get the normalized figure representative of the range of values of predicted output. \(MPE\) represents the prediction error as a percentage of the actual value, whereas \(MAPE\) rules out any balancing effect due to the cancellation of positive and negative errors. The procedure of the proposed system model is presented in Algorithm 1. The input _data_ comes from the user premises in the form of various communication _parameters_ and QoS _targets_.