# Towards the Detection of GPS Spoofing Attacks against Drones by Analyzing Camera's Video Stream
## 4 Analysis and Simulation
### Influence of Ambient Light  
Ambient light can influence how the terrain trajectory changes. We note that our method relies on the video stream from a drone's built-in camera, which does not provide any special night vision capabilities or the ability to see in total darkness.  
Experimental Setup: To obtain images with different levels of daylight, which are not available from Google Earth, we used an image processing technique commonly used to darken images [26]. This allowed us to simulate four lighting conditions: 75%, 50%, 25%, and 10% light (see Figure 9) at altitudes of 50-200 m. In this experiment, one location was used (location #1), along with the four lighting conditions. As mentioned in Section 4.2, the simulation ended immediately after the drone was out of the scope of the first image.  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Speed** & **Linear Function** & **RMSE** & \(\mathbf{R^{2}}\) & **MEA** \\ \hline
5 m/s (18 km/h) & \(-1.351\)X + 104.897 & 181.7630 & 0.8930 & 11.4522 \\
10 m/s (36 km/h) & \(-1.105\)X + 97.275 & 247.5627 & 0.8547 & 13.2745 \\
20 m/s (72 km/h) & \(-1.178\)X + 100.595 & 237.1031 & 0.8723 & 12.2619 \\ \hline \end{tabular}
\end{table}
Table 7: The effect of the flight terrain on the performance; the results are presented for location #2 and an altitude of 50 m, at various speeds.  
\begin{table}
\begin{tabular}{c c c c} \hline
**Speed** & **Linear Function** & **RMSE** & \(\mathbf{R^{2}}\) & **MEA** \\ \hline
5 m/s (18 km/h) & \(-0.714\)X + 116.341 & 240.2957 & 0.8761 & 13.4783 \\
10 m/s (36 km/h) & \(-0.726\)X + 117.098 & 250.6292 & 0.8748 & 14.0265 \\
20 m/s (72 km/h) & \(-0.729\)X + 118.303 & 239.9461 & 0.8797 & 13.8666 \\ \hline \end{tabular}
\end{table}
Table 8: The effect of the flight terrain on the performance; the results are presented for location #2 and an altitude of 100 m, at various speeds.  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Speed** & **Linear Function** & **RMSE** & \(\mathbf{R^{2}}\) & **MEA** \\ \hline
5 m/s (18 km/h) & \(-0.714\)X + 116.341 & 240.2957 & 0.8761 & 13.4783 \\
10 m/s (36 km/h) & \(-0.726\)X + 117.098 & 250.6292 & 0.8748 & 14.0265 \\
20 m/s (72 km/h) & \(-0.729\)X + 118.303 & 239.9461 & 0.8797 & 13.8666 \\ \hline \end{tabular}
\end{table}
Table 9: The effect of the flight terrain on the performance; the results are presented for location #2 and an altitude of 200 m, at various speeds.  
Figure 9: The view of an urban location (location #1) from an altitude of 1.2 km in various lighting conditions (ranging from 75 to 10% light).  
Results and Conclusions: Once again, several interesting observations can be derived from the results, which are presented in Tables 10-12: (1) RMSE: we observe that when there is less light (reflected in the darkened images), the RMSE value increases; (2) \(R^{2}\): as the amount of light decreases, we observe a slight decrease in the values for this metric; (3) MEA: as the amount of light decreases, the MEA value increases; (4) for all lighting conditions, the best results obtained are for an altitude of 200 m; (5) poorer results are obtained when the lighting level is under 25%. Our solution relies on the fact that there is a change in terrain for every frame transition; these changes cannot be detected in dark conditions, which is why the ambient light affects our solution.