# On the Application of Machine Learning to the Design of UAV-Based 5G Radio Access Networks
## 4 ML-Based Designs
### Design of Collectors and Relays  
UAVs can be used as collectors and relays in IoT applications [66; 67]. With reference to Figure 6, the UAV starts its journey towards the source (S) at time \(t=0\) with speed \(v\), to collect its data at \(t=\delta/2\) (_first phase_ or _hop_). In the _second phase_ or _hop_, which starts at \(t=\delta\), the UAV flies to the destination (D) and sends the data in its buffer to D at \(t=3\delta/2\). It is obvious that, compared to static relaying with fixed relays at a given position, such a mobile relaying strategy allows one to shorten the link distance in each of the two hops. Figure 5: A block diagram view of RRA via ML. Figure 6: A scenario where the UAV is used as collector–relay. With reference to this problem, an approach based on genetic algorithms (GAs) has been proposed in [68], where a delay-tolerant network is considered with ground nodes far apart from each other. Such nodes communicate through flying UAVs from one location to another and a static area having nodes with fixed traffic generating features is assumed. Results in [68] show that the GA-based approach outperforms other schemes in terms of delivery ratio, although it does not always present the best average delay. However, in real operative scenarios, data traffic dynamically changes and optimally finding the speed and location of UAVs to support the nodes efficiently is an open problem. The design of the UAV trajectory, to collect and ferry data from multiple widespread sensor nodes, has been considered in [69]. To this aim, an RL algorithm is used by assuming a slowly changing scenario, in which a single UAV can potentially adapt its trajectories to these changes. However, the extension to the case of multiple UAVs and the incorporation of other rapidly changing variables, such as channel state information and user requirements in terms of delay, still remain to be addressed. Other open issues are pointed out in [69; 70]. The choice of the best positions to collect data from S and deliver it to D, as well as the storage capacity and speed of the UAV, are crucial issues to fulfill a QoS target in terms of reliability and latency, when several nodes and UAVs are involved. For instance, UAVs should choose the best speed and stop point to fulfill all nodes' communication requirements. The best speed can be calculated by a regression model with SL and the stop point can be obtained by RL. Specifically, SINR values, activation periods, required data rate and delay sensitivity, and UAV features (i.e., buffer size, processing capability, and maximum hovering time) can be considered as data for training in a SL approach. The optimal speed of the UAVs is considered as the desirable output. With mobile collector-relaying, UAVs constantly fly between the source and the destination, with the aim of reducing the link distances during both UAV information reception and relaying phases. Searching for the best location of UAVs with model-based approaches is a difficult problem, since many restriction and assumption should be considered. Such a task can indeed be solved by resorting to RL approaches [38; 71]. Agents in RL are UAVs, and their flying parameters are the system state; in a certain time period, the numbers of satisfied users are measured as reward function; the action consists of lowering or increasing the speed of the UAVs. Another crucial aspect is the adjustment of the transmit power of the UAV relays, which can be evaluated by using a ML algorithm. In this case, the outage probability due to low power is considered as a loss function to be minimized. The location of the users, their densities and communication requirements, and the mutual distances among UAVs are inputs to the ML box. The reward or loss function can be the power level of the UAVs and the percentage of non-satisfied users. The latter one can be evaluated through different methods.