# A Neural Network Propagation Model for LoRaWAN and Critical Analysis with Real-World Measurements
## 5 Discussion  
After optimization, the resulted mean square errors (MSE) for the log-distance, COST231, and the adjusted COST231 models were derived as 45, 20.47, and 21.83, respectively. As expected, the log -distance model did not have the accuracy of the site-specific models. For the COST231 model and its adjusted variants, the difference in the MSE was almost negligible, and they performed the same in terms of propagation estimation. It is observed that the major difference between the results of COST231 and its adjusted variation was the attenuation coefficient of the first penetrating wall (\(a_{1}\)). The COST231 model did not sufficiently account for the outdoor losses. However, this deficiency was compensated within the optimization by increasing the attenuation of the first penetrating wall (\(\alpha_{1}=12.79\) dB). This is because the \(\alpha_{1}\) was present in all of the optimization objective functions. In the adjusted model, however, outdoor loss compensation was handled by the \(n_{A231}=2.4\); therefore, resulting in a lower value of \(\alpha_{1}=5.10\) dB compared with the COST231 model. The lower \(\alpha_{1}\), which was derived from the adjusted model, is a better and more reasonable estimate, because the wall \(k_{1}\) had plenty of large windows that should have facilitated the penetration [37; 38; 39; 40; 41]. This effect is clear at measurement location 13, which had the highest RSSI recorded (see Figure 2). Despite \(n_{A231}\) increasing the outdoor loss by a factor of 2.4, none of the other attenuations were altered to a great extent to be noticeable, which further emphasized that it is only adjusting the outdoor propagation. In addition, according to the documented empirical coefficients [35], the path loss of \(n_{A231}=2.4\) resembled the propagation at 900 MHz. This adjustment not only corrected the attenuation of the first penetrating wall and the LoS, but has also identified the propagation characteristics. This simple adjustment in the COST231 model made it more applicable to an outdoor-indoor scenario. The introduced coefficient (\(n_{A231}\)) in the adjusted COST231 model correctly represented the propagation characteristics of LoRaWAN in an outdoor LoS condition; however, the log-distance path loss exponent (\(n=3.6\)) and \(\sigma=6.8\) demonstrated a notable loss, as the LoRa encountered obstacles on the propagation path into the building. This susceptibility of LoRa resulted in the parameters that indicated the propagation in indoor environments, however, at the frequency of 1.5 GHz instead of 860 to 900 MHz. The \(L_{c}=4.1\) dB is nearly in an agreement with the \(L_{E}=3.4\) dB; these parameters were added to the COST231 and log-distance models respectively to account for any potential losses in the system. Figure 6: (**a**) Comparison between the COST error (\(E_{A231}\)) and the ANN estimation of the COST error (\(T_{E_{NN}}\)); (**b**) Comparison between measurement of the received signal strength indicators (RSSI), COST’s optimized estimation (\(F_{A231}\)), and compensated COST by ANN. Generally, the training of an ANN requires a large set of inputs-outputs. For propagation estimations, this translates to numerous measurements at different locations. For a relatively small indoor environment, this defeats the purpose of propagation estimation. Furthermore, due to the limited number of measurements, training the network so that it learns and generalizes the propagation mechanisms proved to be challenging, especially if the objective of the design is to achieve a better accuracy/precision. Therefore, to facilitate the training of the ANN with limited measurement samples, input data sets are preprocessed before being passed to the network. For instance, instead of providing the network with the LoS length (\(d\)); initially, \(L_{FS}(d)\) is calculated, then scaled by the path loss exponent (\(n_{A231}\)), and passed to the network.