# Machine Learning-Based Methods for Enhancement of UAV-NOMA and D2D Cooperative Networks
## 4 ANN-Based Placement Scheme Selection
### Data Set Generation  
In this subsection, the dataset generation procedure concerning the training of the ANN model is presented. The objective of the ANN model is to predict the UFBS placement method to enhance the overall communication quality according to specific key performance indicator (KPI). In this work, the considered KPI that should be improved is the total system sum rate, \(R_{s}\), given in expression (23). Hence, the optimization problem that the ANN model aims to solve is represented by Equation (23), which expresses the objective function that the ANN model seeks to maximize. This can be achieved through the ability of a well trained ANN model to recognize patterns, indicating when each method should be conducted to achieve the highest system sum rate. Using Equation (23) as a KPI for dataset generation ensures that the generated data is relevant and valuable for training and evaluating ANN models. Furthermore, incorporating a KPI directly aligned with the problem being addressed can guarantee that the model is configured optimally for the targeted classification task and exhibit superior performance for the specific issue [35]. Hence, considering the k-means and the k-medoids algorithms, the ANN should determine which of these two UFBS placement methods will achieve the highest \(R_{s}\). Furthermore, the calculation of \(R_{s}\) involves various transmission parameters of the considered wireless communication system presented in Section 2, such as the 3D location of the UFBS, as well as the A2G propagation model. Therefore, all these aspects should be carefully considered during the training procedure of the ANN model. In general, optimizing the total system sum rate, i.e., the \(R_{s}\), can offer valuable insights into the optimal allocation of system resources, including bandwidth and transmit power [36]. In the context of a UAV-NOMA and D2D cooperative network, optimizing \(R_{s}\) can help identify the most effective resource allocation strategies for achieving optimal system performance. For instance, optimizing the total system sum rate allows the cooperative scheme to allocate bandwidth and power to UAVs and D2D users to maximize the total data rate transmitted over a given period. In addition, this optimization process can consider the physical layer parameters of the UAV and D2D users, including their communication requirements. For example, UAVs may require higher power allocations to maintain stable connections due to their altitude. Additionally, the distance of D2D users from the UFBS can impact their channel conditions and overall communication performance. Considering these physical layer parameters during the optimization process, the system can allocate resources more efficiently and effectively, leading to improved overall performance. In summary, optimizing the sum rate in a UAV-NOMA and D2D cooperative network can help achieve the best use of resources and enhance the system's overall performance. It is noted that the proposed capacity based optimization of the \(R_{s}\) can be considered as the upper bound on the maximum amount of data that can be reliably transmitted over a communication channel as the size of the channel goes to infinity. However, achieving this limit is often difficult in real world scenarios due to practical constraints such as noise and interference in the channel. Focusing on the data set generation process, Monte Carlo simulations were carried out using Matlab(r) (MATLAB (Version R2021a) [Computer software]. MathWorks, Natick, MA, USA) software to conduct the entire training data set \(D\), following the system model described in Section 2 and depicted in Figure 1. More specifically, in each simulated transmission frame, the GMTs are generated randomly following the uniform distribution into the circular region of interest, while the UFBS is placed through the two unsupervised algorithms mentioned above.