SNR Prediction with ANN for UAV Applications in IoT Networks Based on Measurements

The 5G deployment brings forth the usage of Unmanned Aerial Vehicles (UAV) to assist wireless networks by providing improved signal coverage, acting as relays or base-stations. Another technology that could help achieve 5G massive machine-type communications (mMtc) goals is the Long Range Wide-Area Network (LoRaWAN) communication protocol. This paper studied these complementary technologies, LoRa and UAV, through measurement campaigns in suburban, densely forested environments. Downlink and uplink communication at different heights and spreading factors (SF) demonstrate distinct behavior through our analysis. Moreover, a neural network was trained to predict the measured signal-to-noise ratio (SNR) behavior and results compared with SNR regression models. For the downlink scenario, the neural network results show a root mean square error (RMSE) variation between 1.2322–1.6623 dB, with an error standard deviation (SD) less than 1.6730 dB. For the uplink, the RMSE variation was between 0.8714–1.3891 dB, with an error SD less than 1.1706 dB.


Introduction
The Number of Internet of Things (IoT) applications tends to further increase with the 5G extension across the globe. The technology will offer services such as massive machine-type communications (mMTC), which supports 100 times more devices per unit area than 4G, sending small data payloads periodically [1]. However, there are regions where 5G signals will be intermittent, low quality, or even unreachable, increasing the deployment and maintenance costs for IoT applications.
The Long Range Wide-Area Network (LoRaWAN) is an IoT protocol that uses Chirp Spread Spectrum (CSS) modulation. The spread spectrum technology is well-known for its low signal power level and higher spectral redundancy. Moreover, the signal level in spread spectrum applications operates below the noise floor, which means, to transmit information free of error considering a fixed Signal-to-Noise Ratio (SNR) value, only the signal bandwidth needs to be increased [2].
In LoRaWAN transmission, the CSS uses the Spreading Factor (SF) parameter, which plays a vital role. Increasing the SF value is the same as Increasing the signal bandwidth. Additionally, higher SF values mean an extension in range and higher receiver sensitivity (SNR values up to −20 dB). However, the payload size is reduced for higher SF, and transmission time on-air takes longer [3].
The LoRaWAN protocol, characterized by low power consumption, low data rate, and low cost, fulfills different IoT application requirements and already works in many services, such as farming inspection, security monitoring, and healthcare [4]. Moreover, 5G cellular IoT systems have limited maximum scalability and cannot fully satisfy the 5G mMTC target, and due to the aforementioned factors, the LoRaWAN protocol is a feasible solution that can contribute to future 5G-IoT non-time-critical sensor applications [5].
Unmanned Aerial Vehicles (UAVs, also known as drones) are another technology applied in the aforementioned services [6], and along with 5G, they are expected to increase the resilience of communication networks in emergency cases, that is, natural disasters. In [7], the authors developed an autonomous system to deploy UAVs for communication recovery during disasters and wide-area relief. Hence, UAV will help to improve network coverage in these cases and in situations where signals deteriorate because of many obstacles [8].
In this way, Long-Range (LoRa) and UAV are complementary technologies that can work together to improve 5G mMTC services and network coverage. Thus, it is necessary to understand how UAVs affect LoRa signals and their behavior through a communication channel. There are two traditional methods to analyze the communication channel: deterministic methods, such as Ray-Tracing (RT), which require a thorough model of the environment, and Stochastic methods based on exhaustive propagation measurement campaigns with different methodologies [9].
Therefore, this study analyzes the SNR for the LoRa technology communication channel at 915 MHz between a UAV and a moving receiver in a suburban densely wooded environment using ANN. Furthermore, the SNR use also considers the LoRa adaptive data rate technology (ADR), which adjusts SF accordingly with channel conditions [10]. Finally, a prediction model based on these measurements is proposed and compared with regression models generated with the same measurements. Figure 1 shows the necessary steps for the work completion, starting from measurement and data collection, which will describe the scenario and equipment used. Next is the Data processing module, in which only the relevant data to be used in the models is selected. Following that, is the ANN training in which the processed data are used as input and output sets. After, the development of baseline models, based on regression models using the data processing results. Finally, the model comparison is followed by the work's conclusions. The contribution of this study can be summarized as follow: 1.
Verify the necessity of downlink and uplink analysis due to the reciprocity principle [11].

2.
SNR downlink and uplink measurement campaigns using a UAV to understand how the signal behaves in a suburban and densely forested environment, considering both Line-of-Sight (LOS) and Non-Line-of-Sight (NLOS) situations.

3.
Different SNR regression models and an ANN-based prediction model were established to represent the signal within Amazon cities, which could be reproduced in similar environments. Additionally, the proposed models could assist in improving LoRa ADR technology.
The remainder of this paper is organized as follows: Section 2 shows current state-of-theart, Section 3 presents our study methodology, measurement campaigns, and collected data, followed by Section 4, which presents the results, and Section 5 presents the conclusions.

Related Works
In [12], the authors studied the use of UAVs in wireless networks, investigating the key challenges, applications, and fundamental open problems. They also presented UAVenabled wireless networks challenges and the need for more realistic UAV channel models covering diverse environments and weather conditions. Furthermore, they indicate the necessity for Aerial-to-Ground (A2G) small-scale fading and UAV-UAV communications models.
In [13], the authors presented a comprehensive survey on measurement-and simulationbased radio propagation channel (RPC) modelling for low-altitude and UAV-enabled wireless networks, considering both downlink and uplink scenarios. The authors also described open research gaps, use cases, and the main problems. For example, UAV RPC modelling is limited to open areas with LOS links, at very low altitudes, and provides limited large-and small-scale fading analysis. Furthermore, the authors demonstrated the importance of studying UAV mobility and hovering, transmitting and receiving in both LOS and NLOS links.
In [14], the authors designed a flying gateway that aimed to extend the IoT gateway's terrestrial coverage. First, they used a LoRa gateway and interface Long-Term Evolution (LTE) integrated into UAVs. Next, an endnode LoRa sent data as the received signal strength indicator (RSSI), humidity, and temperature in the uplink channel. Finally, the LoRa gateway sent data received via LTE interface to be displayed and analyzed in a server. The findings of this study demonstrate the feasibility of combining LoRa, UAV, and LTE to increase signal coverage in areas where terrestrial gateways do not reach. However, the authors did not analyze the communication channel or downlink scenario.
The author's goal in [15] was to implement a system to monitor crops and farms using a flying LoRaWan gateway. They conducted two different tests: one in a parking building, and the other in a tree farm. The first showed a decrease in communication speed as the drone moved away from nodes horizontally. The second, i.e., in a tree farm, multiple connections between the Gateway and many endnodes were feasible. However, as in the study [14], authors in [15] analyzed only the uplink scenario.
In [16], the authors proposed a radio propagation model for a LoRaWAN network. They studied the Beirut-LB city environments by measuring RSSI and SNR for indoor, outdoor, urban and rural zones at 868 MHz using the SF 12. The results demonstrate the reliability of the LoRaWAN network for numerous IoT applications, reaching 9 km of coverage for dense urban areas and up to 47 km for the rural case, with a 90% packet delivery ratio threshold for both. However, the authors did not modify the SF, considering only the lowest data rate (DR), which in some cases might not be viable. In addition, uplink communication was the only one analyzed.
The authors in [17] studied the LoRa communication behaviors for indoor, outdoorto-indoor, and urban environments, also analyzed the antenna polarization effects on transmission. For the urban environment, drones were utilized to increase transmission coverage. The authors discovered that drone height and antenna orientation are crucial in receiving signal strength (RSS). Drone heights of 25 and 50 m do not significantly impact RSS, but if the transmitting antenna is vertical, the received signal becomes stronger. However, the author used only one SF and restricted the work to examining uplink communication.
Most of the aforementioned studies considered only one propagation direction, either downlink (gateway to endnode) or uplink (endnode to gateway). In certain situations, unidirectional propagation modelling may represent communication channels in both ways owing to the reciprocity principle [11]. However, in this study, the propagation path between the transmitter and receiver contained a blend of open areas, buildings, and densely forested areas, that is, the terrain was not isotropic [18], and the reciprocity principle could not be used. Hence, it is relevant to conduct a comprehensive RPC study considering LOS and NLOS for UAV-enabled wireless networks in the most diverse cases.
Another approach is to use heuristic techniques for channel modelling using artificial neural networks (ANN), which are powerful tools capable of approximating any function [19].
In [20], the authors measured the received power at 521 MHz for a hybrid city-river environment to predict the electric field through an ANN. The ANN was also used in [21], in which the authors measured RSS to propose a path loss model for three different frequencies: 900 MHz, 1800 MHz, and 2100 MHz.
In addition, the authors in [22] proposed a propagation model for heterogeneous networks. They trained an ANN to predict the path loss using the measured received power at the following frequencies: 450, 850, 1800, 2100, and 2600 MHz. Moreover, ref. [23] used LoRa technology to measure RSSI for a downlink scenario at 868 MHz in a tropical environment and utilized an ANN to model path loss.
The works mentioned above proposed ANN models to characterize the environment and compared their results with classical propagation models, such as Okumura-Hata, Lee, and SUI. Their results showed the better performance of the ANN, proving its efficiency in predicting path loss in diverse circumstances.
Therefore, this work motivation is the need for more realistic UAV RPC models, considering both LOS and NLOS scenarios and the lack of uplink and downlink analysis in the same environment for the LoRa technology with different SF values.

Methodology
This section describes the proposed methodology, measurement campaigns that were conducted, uplink and downlink data analysis, and neural network configurations.

Measurement Campaign
At the Federal University of Pará (UFPA), measurements were conducted to obtain channel information in the 915 MHz frequency band using the LoRaWAN protocol. The measuring equipment consisted of two LoRa devices, a car, and an Inspire 1 model UAV.
The chosen setup has a LoRa gateway attached to the UAV. In addition, the vehicle had a LoRa Dragino (an Arduino-based LoRa sensor) coupled to it at a 3-m height. Messages were sent and received, which enabled downlink and uplink communication analysis. The UAV position were between 6, 24, 42, and 60 m high. The vehicle was driven at a constant speed of 35 km/h. Figure 2 shows the measurement scenario. Where h is the UAV height from the ground, D t is the terrestrial distance, and D r is the radio distance between the car and the UAV. After defining the measurement scenario, it is necessary to define the transmission logic as shown in Figure 3. First, the vehicle sends a packet with geolocalization value to the UAV gateway. The UAV Gateway calculates the uplink SNR and sends this new information to the vehicle. When the vehicle receives the data, it calculates the downlink SNR and then extracts packet information. Furthermore, a database of measurements is filled through serial communications between the endnode and the computer.
The LoRa device was set up with the transmitter power equal to 20 dBm, 500 kHz bandwidth, 915 MHz operation frequency, and SF values switching between 8, 9, 10, and 11. The car, as shown in Figure 4, moves along two routes inside the UFPA to perform measurements, as visualized in Figure 5. Route 1 is represented in blue, and is approximately 680 m long, while Route 2, in yellow, is approximately 1050 m long. The green marker represents the UAV position during the measurement campaign, and the red circles represent the wooded area with trees approximately 30 m high on each route. Each route was measured four times for each SF and drone height.

Data Preprocessing
After the measurement campaign, data were analyzed to calculate path loss and distance between the UAV and the vehicle, used as ANN input.

Distance between UAV and Vehicle
The latitude and longitude values were used to calculate the distance between the car and the UAV through the Equation (1) based on the Haversine equation.
where Dr is the radio distance between the UAV and vehicle in meters; r is the radius of the earth in meters (6,371,000 m); ϕ 1 , λ 1 represent the coordinates (latitude, longitude) of point 1; ϕ 2 , λ 2 represent the coordinates (latitude, longitude) of point 2; h is the UAV's height from the ground.

Path Loss Calculation
The path loss is another input of ANN and is calculated for each measured value through the Equation (2).
where Pl is the path loss at a given point in dB; Pt is the transmitted power in mW; G is the sum of transmission and reception gains in dBi, and Pr represents the received signal power in mW.

Collected Data
After measuring each route four times for each SF and drone height, the total collected data were 3614 samples, divided between uplink and downlink. Figure 6 shows how the downlink SNR samples are distributed through the routes.   The SNR behavior remains the same as that in downlink communication: when the car moves away from the drone, the SNR reduces. However, in some stretches of both routes, the signal was drastically attenuated for the uplink, as evidenced by the significant reduction in its range. In Route 1, the trees perform a reduction in SNR until the signal becomes intermittent and weak; in Route 2, the wooded area demonstrates a more significant impact, since immediately after the vehicle goes behind, the signal disappears.
The SNR values obtained in the measurement campaign remained between 0 dB and 9 dB for the uplink.
The lowest SNR values were found when the trees obstructed the transmission link between the transmitter (car) and receiver (drone), specifically when the car went near the vegetation-dense spots. For example, for a height of 42 m, the lowest values found were 0 dB in the positions illustrated by the magenta triangles in Figure 7. Only values of SNR equal to or greater than zero were obtained. Negative SNR values were not obtained because the SNR level was lower than the threshold defined in the datasheet [10], mainly because of the attenuation and spread phenomenon caused by trees. Figure 8 represents all collected data for the downlink scenario; we can observe the SNR decaying according to the drone's height, its distance from the vehicle, and the SF used. Furthermore, through figure analysis, it is possible to observe that the coverage area increases according to these parameters, for example, drone height and SF. When the drone position was defined at a height of 6 m, the observed coverage/communication area reaches approximately 500 m D r (except for SF 11, which reached a greater distance). Additionally, for the other established height values, the gateway was capable of communicating with the endnode during all routes.  Figure 9 illustrates all the data obtained for the uplink scenario. When observing the drone positioned at a height of 6 m, it was possible to verify that it did not receive much data, obtaining a maximum D r range of 400 m. Considering the uplink as the main channel for most IoT applications, drone height is unfeasible. However, when analyzing other drone heights, the signal's D r range was close to 600 m with similar behavior for all SFs, covering UFPA's entire central region.
By analyzing Figures 8 and 9, it is evident that downlink and uplink communication channels have different conducts. For example, in Figure 8 it is possible to observe a chaotic behavior, at low altitude in the range of 200 m to 500 m, then an accentuated decay in SNR values. In contrast, in Figure 9 the signal has a lower range and does not have well-defined behavior.
Therefore, from the results gathered in the experiments, the need to model propagation characteristics in both ways (gateway to endnode, and endnode to gateway) for mixed environments within the suburban context of Amazon rainforest cities became evident.

Artificial Neural Network
After data processing, according to the inputs: drone's height, SF, radio distance, and propagation loss, a general regression neural network (GRNN) was trained to predict the SNR values for both uplink and downlink occasions.

Generalized Regression Neural Network
The GRNN is a method for estimating the joint probability density function (PDF) given only a training set. The system is perfectly general because the PDF is derived from data without preconceptions regarding its shape. There are no problems if the function is composed of multiple non-Gaussian disjoint regions in any number of dimensions or simpler distributions [24]. For this ANN, the outputs were modelled as such: where, y j is the estimated function value; w ij is the desired output corresponding to the input training vector x i and output y j ; h i = e − D 2 i 2σ 2 is the output of a hidden layer neuron; is the squared distance between the input vector x and the training vector u; u i is the training vector, i is the center of neuron i; σ is a constant controlling the size of the receptive region.
The main advantage of GRNN over traditional training neural networks such as back-propagation neural networks (BPNN) is the shorter training time, which confirms its selection for modelling and controlling dynamic systems. In addition, GRNN has minor testing errors, which means that it has better generalization ability than BPNN [25].
The GRNN used in this study has the spread parameter, which determines how smoothe the function approximation is. The GRNN was set with spread value 8 to fit the data more smoothly (smaller values fit the data closely). The GRNN is composed of four inputs, two hidden layers, the first with 2542 neurons that use the radial basis transfer function. For the first layer, the number of neurons is equal to the number of training samples. The second layer has one neuron and uses the purelin transfer function, and the network has only one output, the SNR. Figure 10 illustrates the design of the GRNN network proposed in this study.

Neural Network Training
The cross-validation process was used to train the GRNN to mitigate any bias caused by the particular sample chosen for training [26], with k = 10. In the traditional 10-fold cross-validation, data is split in 10 equal parts. The training process occurs in 10 iterations, for each iteration 9 folds (90% of measured data) are used in training and 1 fold (10% of measured data) is used in test [27].
The process of 10-fold cross-validation training generates 10 different GRNN models. However the training process was repeated 100 times to ensure statistical variability, generating 1000 different GRNN models. The mean of error results are calculated to obtain GRNN model performance. Figure 11 illustrates the cross-validation process.

Results
This section presents and compares the baseline models and the proposed neural network. The best model was shown based on the obtained results.

Downlink
In this section, we describe the downlink scenario. There were three regressions over the measured data for each SF and height, totalling 48 regressions for the entire downlink scenario. Figure 12 displays the three regressions for each SF, in downlink, when the UAV is at 42 m high. The curves in Figure 12 seem to fit the measured data well. Their root mean square error (RMSE) and error standard deviation (SD) values, together with their coefficients, are represented in the Table 1. The table demonstrates that most regressions presented similar results for each SF, with minor errors associated with SF 8 and a lower SD. The minimum RMSE value was 2.4249 dB for SF 8 (with linear regression), and the maximum was 3.3228 dB for SF 9 (with power regression). Appendix Table A1 presents a table with the regression coefficients and RMSE for all downlink measurements. After establishing a baseline, the effectiveness of the neural network was evaluated. The predictions of the best neural network are shown in Figure 13.

SF 11 -Downlink Prediction
Measured data Prediction Figure 13. Downlink Best Neural Network. Figure 13 presents the results for the test data (which the ANN does not have access to during the learning process) in order to assess the predictive capability. It is possible to visualize the considerable accuracy presented by the model, as confirmed by the general 1.3817 dB RMSE and general 1.3784 dB error SD values. Table 2 summarizes the results of the best neural network model for each SF.  Table 2 shows that SF 9 obtained the greatest error, that is, 1.6623 dB, and SF 8 presented the minor, that is, 1.2322 dB. Finally, by comparing Tables 1 and 2, it can be seen that the neural network model achieved better results than the established baselines for all SFs, with a difference of approximately 1 dB.

Uplink
This section presents the neural network results obtained for the uplink scenario and establishes baseline regressions. Figure 14 shows the three regressions over measured data for uplink when the UAV is at 42 m high. The fitted curves are shown in Figure 14 with RMSE below 2 dB for all three regressions and all SFs. Table 3 shows the RMSE and error SD for these uplink regressions with their respective coefficients. Appendix Table A2 presents a table with regression coefficients and RMSE for uplink measurements for each SF and the UAV s height. In the uplink scenario, minor errors were associated with an SF of 9. The minimum RMSE value was 0.8245 dB for SF 9 (with linear regression), and the greatest RMSE value was 1.3233 dB for SF 11 (with power regression). Next, the results of the best neural network were compared with these baselines to verify their effectiveness. Figure 15 displays the predictions of the best neural network for uplink test data. The neural network also presented a good predictive capability, with a general RMSE of 1.1102 dB and a general error SD of 1.1094 dB. For the best model, the RMSE remained below 1.4 dB for all SF. A slight difference between all SF was observed for the uplink. Table 4 contains the neural network results for each SF.  Table 4 shows that apart from the minor errors obtained for SF 8, the model was capable of predicting SNR satisfactorily in the uplink scenario with an RMSE of approximately 1 dB. Finally, comparing Table 3 with Table 4, it can be observed that the neural network performed worse than the regressions in SF 9 only. Nevertheless, the network presented promising results for both downlink and uplink communications. Therefore, the ANN use is viable for understanding how the signal will behave in a densely wooded suburban area, and the ANN-trained model for predicting transmission coverage and interference proposed in this paper should be able to optimize and aid future planning of wireless (LoRa-UAV) networks.

Conclusions
In this study, measurements were conducted at the Federal University of Pará to understand how the signal behaves in the communication between a UAV and moving vehicle located in a densely wooded suburban environment. The work showed that uplink and downlink channels exhibit different behaviors due to the difference in propagation media (vegetation and buildings, LOS, and NLOS) in the path of the electromagnetic wave between the transmitter and receiver. Another objective was to train a neural network model capable of predicting the measured SNR, helping to study the communication channel.
Data analysis showed an increase in range according to the established drone height and SF. Another highlight was the increase in reception sensitivity with an increase in the SF. The downlink communication distance reached the entire route, and this range was reduced to approximately 0.6 km for uplink.
Three baseline models and one neural network model were established. Their results showed that the neural network model surpassed all the regressions and presented the best results for both cases, obtaining a minimum RMSE of 1.6623 dB and a minimum error SD of 1.6730 dB in the downlink. A minimum RMSE of 1.3891 dB and error SD of 1.1706 dB were observed in the uplink analysis.
The significant downlink data variation showed the capability of neural networks to handle complex information because the prediction results were good for both downlink and uplink scenarios. The results obtained demonstrate the feasibility of using the model for channel analysis in this type of environment and its application to optimize the performance of LoRa-UAV networks.
In future work, applying the neural network model is expected to optimize the choice of SF and the UAV's height to guarantee signal delivery with an acceptable SNR. Additionally, we would compare the GRNN models with other artificial intelligence techniques to verify which is best to solve the problem by comparing other metrics, such as computational cost and processing time.