# Machine Learning Techniques for Non-Terrestrial Networks
## 6 Machine Learning Techniques in NTN
### ML for NTN Service
Multi-connectivity, which has the aim of maximizing the throughput, is another technique that can benefit from the optimization provided by ML in the hybrid NTN/TNenvironment. For example, a RL algorithm could learn to select the most convenient couple of transmitters between terrestrial (i.e., gNB) or non-terrestrial (i.e., UAV, HAPS, and LEO) or among the NTEs available in a given area. Parameters that should be taken into account by the RL are the NTE and UE trajectories, congestion estimation of both NTEs and terrestrial gNBs, signal quality received by the target UE or coverage estimation. Referring to the architecture described in Section 4.4, the RL technique should take into account the position of the transmitting gNBs (on the ground, on air or on space) and the related latencies on the Xn interface. **Secondary link backup. ** Service outages are frequent in today's internet communications, most of which are due to a variety of reasons (e.g., out-of-coverage, network failures, provider maintenance, and equipment failures). As described in Section 4, NTN can be exploited to quickly restore the link by deploying NTEs, such as UAVs, HAPS and LEOs. However, deploying an UAV or HAPS may take lot of time, and it often require to be planned in advance. ML can shorten the downtime by classifying the failure, thus helping the network operations to solve the problem in less time. In [37], the authors developed a classifier for 15 different kinds of failures by using bidirectional forwarding detection (BFD). Results showed that using these features, a 0.99 F1-Score is achievable for link failures. Radio link outages can also be predicted by using ML. More specifically, in [38], the author proposed a combination of long short-term memory (LSTM) and neural network (NN) to find a correlation between radio measurements, such as signal power and quality, and radio link failures. Training the system on a dataset obtained from a 5G testbed produced a model which was able to predict failures with a 0.94 F1-Score performance. A second aspect arises in cases when a secondary backup link is deployed with the sole aim of guaranteeing service continuity. Then, when the primary and also the backup connections are present, it can be convenient to exploit the secondary link for load-balancing purposes. Traditional load-balancing techniques can be used to decide which link to use. Many of them are based on network metrics, such as packet loss, round-trip latency, or remaining available link bandwidth. However, when several UAVs are deployed as multiple MEC nodes, load balancing can be challenging to be implemented, and in many situations more robust solutions, such as deep RL-based techniques, are recommended. For example, in [39], a deep RL algorithm is conceived for solving the task scheduling problem among \(N\) UAVs acting as MEC nodes, providing service for \(K\) IoT nodes. Regarding the performance metric, the authors measured the average task slowdown \(t_{d}\geq 1\), where it is evaluated considering the positions of the generic UAV and of the IoT node, formulated as the real task completion time over the ideal task completion time. Simulation results highlighted a 65-75% average slowdown reduction compared to the traditional first-come first-served (FCFS) scheduling scheme. **Disaster relief. ** In emergency situations, such as natural disasters, NTEs are used to quickly bring connectivity in order to support rescue teams or enable survivors to call for help. In these scenarios, the UAVs position should be optimized in order to maximize the coverage and minimize the power consumption, thus extending the flight time. In [40], the authors proposed multi-layer perceptron (MLP) and LSTM approaches to optimize the UAVs position according to the user service requirements. Results showed that the combined use of MLP-LSTM reported a 98% user throughput maximization accuracy. UAVs can also scan the area at different altitudes, or track rescue teams by using computer vision techniques.