# Towards the Detection of GPS Spoofing Attacks against Drones by Analyzing Camera's Video Stream
## 5 Real-World Evaluation
### Results  
We present the results of our experiments for a drone flying at altitudes of 50 and 100 m. First, we calculate the average prediction error and maximum prediction error for each time window. Then, for each flight we plot the mean of the average prediction errors and maximum prediction errors at both altitudes (see Figures 12 and 13). We observe that when the time window is small, the average prediction error is high. For example, in Figure 12 the window size is two (meaning two frames are used to build the linear regression function); in this case, the average prediction error is less than one, but the maximum error is high. In addition, in the figures we can see that in the middle frames the maximum error is at the lowest level, and it remains constant for several window sizes; when the window size grows, the error also starts to increase. Figure 11: The drone flight route for location #1 (the **left** image) and location #2 (the **right** image) from an altitude of 100 m.  
Figure 10: The drone flight route for location #1 (the **left** image) and location #2 (the **right** image) from an altitude of 50 m.  
Next, we examine the FPR for specific window sizes in which the maximum prediction error remains constant. For an altitude of 50 m, the maximum error distance is 6 m for all window sizes, and for an altitude of 100 m, the maximum error distance is 5 m for all window sizes. The best results for an altitude of 50 m are for window sizes 4 and 5, where we obtain the lowest error rate for a distance of 4 m (Figure 14). While for 100 m, the best results are for window sizes 5 and 6, where we obtain the lowest error rate for a distance of 3.5 m (Figure 15). False positive alarms may be the result of: (1) the drone's rotation, or (2) an error in the camera's autofocus function, which can result in a blurry frame. To demonstrate this, let us examine two examples from real drone flights. In Figure 16, we can see that the drone is rotating. As a result of this rotation, the frame's similarity decreases to 28, and therefore the correlation between the frames decreases. This causes the model to predict that the distance between the frames (the left and the middle images in Figure 16) is 15 m instead of 1.5 m, which leads to a false positive. In Figure 17, we can see that the middle frame is blurry, and the rest of the frames are clear; as a result of the frame's blurriness, its similarity decreases to 26, and therefore the correlation between the frames decreases. Again, this causes the model to predict that the distance is 9 m instead of 1 m, which leads to a false positive. We also investigate how we can determine the optimal window size for our method, the window size that will minimize both the maximum and average errors. For that, we can use the equation: \(e(\alpha)=\alpha*average_{error}+(1-\alpha)*maximum_{error}\). In Figures 12 and 13, we can see that for an altitude of 50 m the maximum and average errors are obtained for window sizes 4 and 5, while for 100 m they are obtained for window sizes 5 and 6. Figure 12: The prediction error (in meters) vs. various window sizes for an altitude of 50 m (average for the two locations). Figure 13: The prediction error (in meters) vs. various window sizes for an altitude of 100 m (average for the two locations). Thus, for the following configuration, the proposed method can provide a high level of security, detecting any GPS spoofing attack in which the spoofed location is a distance of 1-4 m (an average of 2.5 m) from the real location. Given this, we conclude that the proposed method is capable of protecting a delivery drone from GPS spoofing attacks and could therefore be used for this purpose. Figure 16: Example of a drone flight in which the drone is changing direction (rotating, rather than flying straight ahead), which causes a false positive due to the decreased correlation between the frames (the frames are presented from **left** to **right**).