## 6 Simulation and Results  
We evaluated the performance of deep neural network models using Python, while the scenarios were simulated using MATLAB. Multiple receivers were randomly positioned for the spoofer UAV as it flew in a three-dimensional space. It started at position \((80,50,3)\), and moved for \(10,000\) steps while transmitting a spoofing signal at \(-32\) dBm. The target and three APs were located at the coordinates \((45,35)\), \((30,35)\), \((60,30)\), and \((50,55)\), respectively, as shown in Figure 11. The transmission power was set to \(-35\) dBm for both the target and APs. The dataset comprises \(10,000\) samples, consisting of 7 input features and 2 output features. Two deep neural network models--namely MLP and LSTM--were trained on 8000 measurement data points and evaluated on 2000 samples. During model training, the signal status threshold \(\delta\), which is for classifying the dataset into authentic and spoofed categories, was determined by taking into account the following factors: the system threshold, the SNR, and the distance from the spoofer. \[\delta=\begin{cases}max(\beta_{true})\leqslant\beta,&\text{  
Figure 11: Spoofer UAV hovering around the target area for \(10,000\) steps. The red triangle represents the target node, the cross line represents the AP, and the green circle depicts the trajectory. Figure 12: The actual and predicted values of \(T_{p}\) and Status. Left figure represents scaled \(T_{p}\), while the right figure displays the scaled status. Figure 13: Actual and predicted values of \(T_{p}\) and Status. Left figure represents the inverse of \(T_{p}\), while the right figure displays the inverse of status. The performance of the MLP and LSTM frameworks in spoofing detection is summarized in Table 6, and the results for ToA estimation are presented in Table 7. Both models were trained using a batch size of 25 for 200 epochs when employing the Adam and SGD optimizers. For spoofing detection, the MLP model outperformed the LSTM model significantly in terms of F1 score, accuracy, and precision. Regardless of the optimizer used, either Adam or SGD, the MLP consistently achieved higher scores compared to the LSTM model. The MLP model demonstrated excellent performance with F1 scores close to 1, thus indicating a robust balance between precision and recall. On the other hand, the LSTM model showed lower scores, thereby suggesting an imbalance between precision and recall. For ToA estimation, the MLP model consistently outperformed the LSTM model  
Figure 14: **(a)** The MAE of the MLP model, **(b)** Loss of the MLP model, **(c)** MAE of the LSTM model, and **(d)** Loss of the LSTM model. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{4}{c}{**Patch Size = 25, Optimizer Adam**} \\ \hline  & \multicolumn{2}{c}{**MLP**} & \multicolumn{4}{c}{**LSTM**} \\ \hline \# of Epoch & RMSE & MAE & std & RMSE & MAE & std \\ \hline
10 & 0.050 & 0.508 & 0.426 & 0.375 & 0.512 & 0.155 \\
100 & 0.025 & 0.513 & 0.430 & 0.369 & 0.512 & 0.155 \\
400 & 0.024 & 0.514 & 0.430 & 0.370 & 0.511 & 0.155 \\ \hline \hline  & \multicolumn{4}{c}{**Patch Size = 25, Optimizer SGD**} \\ \hline  & \multicolumn{2}{c}{**MLP**} & \multicolumn{4}{c}{**LSTM**} \\ \hline \# of Epoch & RMSE & MAE & std & RMSE & MAE & std \\ \hline
10 & 0.071 & 0.512 & 0.424 & 0.378 & 0.511 & 0.155 \\
100 & 0.036 & 0.509 & 0.428 & 0.378 & 0.513 & 0.155 \\
400 & 0.035 & 0.512 & 0.428 & 0.378 & 0.512 & 0.155 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison between MLP and LSTM models. Figure 16: Illustration of the predicted and estimated propagation time (Tp) values by the MLP model. Additionally, it provides a comparison between the actual Tp values and the values predicted by the model. Figure 17: Representation of the predicted and estimated status values obtained from the MLP model. The signal status is indicated, where 0 represents an authentic signal and 1 represents an spoofed signal. Figure 15: Illustration of the predicted and estimated distances obtained from the MLP model.