## 4 Network Implementation and Learning Algorithm
### Hybrid DELM Model
The second scenario involved implementing the random forest regression model on a real-time dataset that was collected from the LoRa network. The total predicted LoRa node power consumption was enhanced by 19% compared with the default LoRa network performance with suggested network parameters of SF = 12, TP = 12, BW = 125 kHz, and CR = 3, with an accuracy of 83 in terms of the MSE. Thirdly, the DELM model was executed, and the total enhancement ratio of the LoRa node power consumption with the proposed parameters of SF = 11, TP = 10, BW = 250 kHz, and CR = 3 was calculated, reaching 29% compared with that of the default LoRa network performance, and the model accuracy decreased to 27. Finally, the hybrid DELM model was implemented, and a perfect enhancement ratio was achieved with network parameters of SF = 9, TP = 8, BW = 250 kHz, and CR = 2 for the total predicted LoRa node power consumption, reaching 39% with a model accuracy of 0.75. We also analyzed the other output results of OMNET++, such as time period intervals and the number of transmitted packets, to calculate the node packet delay and packet loss and to evaluate the network performance. We obtained different enhancement ratios for packet delay and packet loss by applying the proposed machine learning models; with the hybrid DELM model, we achieved 33% and 31% for the total packet delay and packet loss, respectively. All the results are described in Table 6, as shown below. The final results reveal that the hybrid DELM model presents a perfect enhancement of LoRa network performance. Table 7 explains the effect of the proposed models on the LoRa node performance; node no. 3 was randomly selected for presentation. Figure 5 shows the enhancement of LoRa network performance by applying the hybrid DELM in comparison with the DELM model, random forest, and default LoRa network. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Parameters** & **Default LoRa** &
\begin{tabular}{c} **Random** \\ **Forest** \\ \end{tabular} & **DELM** & **Hybrid DELM** \\ \hline Total Power Consumed (mWh) & 4332 & 3509 & 3033 & 2686 \\ \hline Packet Delay (ms) & 85,472 & 70,941 & 63,249 & 57,266 \\ \hline Total Packet Loss & 502 & 427 & 387 & 346 \\ \hline Power Consumption & & & & \\ Enhancement Ratio & - & 18\% & 29\% & 39\% \\ \hline Packet Delay Enhancement Ratio & - & 17\% & 26\% & 33\% \\ \hline Packet Loss Enhancement Ratio & - & 14\% & 23\% & 31\% \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Brief comparison of LoRa network performance. ## 6 Conclusion and Future Work

In this research paper, an integrated oil pipeline monitoring solution based on wireless sensor networks was implemented. LoRaWAN was selected as the network infrastructure for the proposed model. The objective of this work was focused on two approaches; the first was the implementation of a real-time oil pipeline monitoring system by utilizing a real-time transient model with LoRaWAN technology to achieve high accuracy in terms of detecting the leak quantity and location while taking advantage of the abilities of LoRa to implement the proposed system with the fewest hardware resources. Second, different machine learning techniques were deployed to enhance the LoRa network performance, including the random forest algorithm, which enhanced the LoRa node performance by 18%, 17%, and 14% in terms of power consumption, packet delay, and packet loss, respectively, compared with the results for the default LoRa network. The DELM model achieved better results, with enhancement ratios of 29%, 26%, and 23%, respectively.