## 4 Network Implementation and Learning Algorithm
### Deep Extreme Learning Machine Model  
In this section, we will explain the effect of deep learning algorithms on the enhancement of LoRa network parameters and try to obtain better performance than that obtained with the random forest model. Deep extreme learning machine (DELM) is a branch of machine learning that presents the ability to analyze complex patterns and find the relationships within data patterns more accurately and faster than traditional machine and deep learning techniques because it utilizes random weights during the initialization of the hidden layer, requiring no reiterative backpropagation for training, making it well suited for optimizing and predicting network performance. A DELM model is deployed to perform analysis on the dataset, which includes the incoming data packet information and the LoRa network parameters. By processing the features in parallel advanced neural network architectures, deep learning algorithms can intelligently regulate node power levels based on previous experience and different factors, e.g., traffic volume, network congestion, transmission power, bandwidth, the spreading factor, coding rate, queuing time, data rate, and the proximity of other devices, as illustrated in Table 4.  
This intelligent power management strategy minimizes energy waste and extends node battery life, in addition to enhancing the overall network efficiency. The input layer, which contains 25 densely connected neurons, receives data representing various network parameters. These data are then passed through a sequence of hidden layers where patterns in the input data are identified and extracted. The first hidden layer and second hidden layer act as the root of the network architecture, where complex transformations and computations occur to optimize and enhance the network parameters within these layers. The DELM model learns complicated relationships between input features and target outputs. Deploying the tanh activation function, it is an innovative technique used to transform the network's inputs, improving the ability of the model to catch complex patterns without repetitively adjusting the internal weights and biases, leading to a quick process and accuracy in the desired results. After multiple stages of testing and tuning the DELM neural network, we obtained the best results with two hidden layers--the first with 50 neurons and the second with 35 neurons. The output layer, involving three neurons, provides the final prediction for the network enhancement parameters, and this is based on the most accurate processed input data. Figure 3 describes the DELM neural network structure. The mathematical approach of the DELM model is described in the following equations [55]. \[H_{1}=\sigma(W_{1}X+b_{1}) \tag{9}\]  
where  
* W1 is a weight matrix that is randomly initialized for the first hidden layer;
* X = {x1.x2..., xn};
* b1 is the bias vector;
* \(\sigma\) is the tanh activation function. \[H_{2} =\sigma(W_{2}H_{1}+b_{2}) \tag{10}\]  
where  
* W2 is a weight matrix that is randomly initialized for the second hidden layer;
* H1 is the output of the first hidden layer, and b2 is the bias vector. \[\beta=H^{+}{}_{2}Y \tag{11}\]  
where  
* \(\beta\) is the output weight matrix;
* \(\mathrm{H^{+}}{}_{2}\) is the Moore-Penrose pseudoinverse of the second hidden layer output;
* Y includes the actual values of node power consumption, packet delay, and loss coming from the dataset. The DELM model regulates its weights for each metric by training with these specific target values to obtain accurate predictions in each case. \[Ypred=f(H_{2}*\beta) \tag{12}\]  
where  
* \(\mathrm{H_{2}is}\) the second hidden layer's output;
* \(\mathrm{f}\) is the linear activation function applied for the output layer;
* Y pred is the predicted output, representing the predicted enhanced network parameters. We used the mean square error as the cost function to measure the difference between the predicted and actual values as a measure of the model's accuracy [54].