# FL-LoRaMAC: A Novel Framework for Enabling On-Device Learning for LoRa-Based IoT Applications
## 6 Results and Discussions
### Performance Study of FL-LoRaMAC
#### 6.2.5 Performance with QoS-Based SF Distribution  
Finally, we study the performance of the proposed QoS-based SF distribution principles. As stated earlier, we assume that the packet transmissions in FL-LoRaMAC are affected by ambient transmissions of packets in the IoT network such as from devices in the network that are not performing ECG anomaly detection. Some of these ambient packets may also be interfering with FL-LoRaMAC's high-priority packets. We assume a requirement of a 90% probability of success for high-priority packets. Also, it is assumed that all end-devices, including those transmitting ambient packets, are transmitting data every 60 s, similar to the devices running the representative application. However, we assume that at any time the network has only 10% high-priority packets out of the total traffic.  
Using this network configuration, the maximum number of devices that can be supported on each spreading factor was computed using Poisson analysis, as tabulated in Table 6. The spreading factors were then allocated to different packets without exceeding the maximum allowable limit, according to the SFA-1 approach. The packet delivery ratios for both high-priority and low-priority devices were then evaluated using [PERSON]'s distribution for a varying number of total devices in the network. These results are plotted in Figure 14.  
To study the effects of the packet losses in the channel, the ECG anomaly detection application was trained and tested using the PDR values for the varying total number of devices illustrated in Figure 14. The significance criteria were chosen to be 80% of the maximum and minimum values. In other words, if the parameter's value is greater than 80% of the maximum value or less than 80% of the minimum value, that particular model parameter is considered significant. The performance of the model trained by applying the pruning technique along with QoS-based distribution and without applying QoS distribution is plotted in Figure 15.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Spreading Factors** & **Max. Number of Devices (D)** \\ \hline SF7 & 50 \\ \hline SF8 & 27 \\ \hline SF9 & 15 \\ \hline SF10 & 8 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Maximum number of devices for various spreading factors with 90% or greater probability of success.  
Figure 14: PDR for high- and low-priority devices for varying total number of devices.  
For comparison, the value of recall was kept fixed at 99.02%, and the mean as well as the standard deviation for precision and accuracy were determined against this recall value. This was achieved by varying the threshold for the prediction. It can be observed that, with an increasing number of devices in the network, the performance of the model degrades. However, the model trained by considering a differential priority of packets (i.e., the proposed QoS-based SF distribution scheme) provides a better performance than the legacy scheme that applies the same priority for all packets. Providing better success rates to high-priority packets that contain more significant parameters helps the model to converge faster when compared to the legacy approach.