# CNN Based Image Classification of Malicious UAVs
## 2 Materials and Methods
### Image Capture  
The methodology for capturing images of UAVs to form a trial dataset was designed to mirror how people are likely to take photos of malicious UAVs for reporting purposes in the field. Specifically, people are likely to use a smartphone for image capture, possibly with optical and/or digital zoom, and the target UAV may be at a different elevation \(h\) and a different horizontal distance from the person taking the photo \(d\) (see Figure 2).  
The images were all captured with an iPhone X which supports a 12 MP (3024 \(\times\) 4032 pixels) autofocus camera with 2\(\times\) optical zoom and 10\(\times\) digital zoom. For each UAV position in terms of a distinct pair of \(h\) and \(d\) values, images were captured with 1\(\times\), 2\(\times\), 3\(\times\), 5\(\times\) and 10\(\times\) zoom. It should be stressed that a distinct photo was taken for each zoom level as opposed to a single image being taken and that image subsequently processed with different zoom levels.  
Elevation values \(h\) of 5 m, 10 m, 15 m, 20 m, 25 m and 30 m were employed. These were measured from the UAV controller display.  
Horizontal distances \(d\) of 0 m (i.e., observer directly below the UAV), 10 m, 20 m and 30 m were employed. These were measured with a standard measuring wheel.  
With an image taken of each UAV for each of 5 camera zoom levels, 6 elevation levels and 4 horizontal distances, the dataset was expected to comprise 5 \(\times\) 6 \(\times\) 4 = 120 images of each UAV. In fact, some additional images were captured for the largest values of \(h\) and \(d\) because a clear image could not always be captured in these cases. A total of 127 images were captured for each of the three UAVs. Therefore, the dataset is balanced in that there are the same number of images taken under similar circumstances for each of the three UAVs. Balanced datasets are preferred for machine learning to prevent a model being trained with a bias for one or more objects of interest.  
It should be noted that there are some other advantages of this methodology for image capture other than simply mirroring what a typical person trying to report a malicious UAV in the field might do. Firstly, the use of different camera zoom levels and different values of \(h\) and \(d\) values changes:  
* the size of the UAV in the image.
* the view angle at which the UAV is captured, thereby exposing different visual characteristics of the UAV.
* the background of the image.  
Figure 2: Distance \(d\) and Elevation \(h\) Parameters Used for Image Capture.  
This increases the diversity of the image dataset, which is known to be very important when the objective is to develop a robust image classification model which can make accurate predictions when exposed to new previously unseen images. For example, Figure 3 illustrates the effect of using different zoom levels (in successive shots) on the size of the UAV in the image and the image background.  
Figure 4 illustrates the effect of different UAV elevations on the size of the UAV in the image, the view angle of the UAV in the image and the image background (note: these images were taken some time apart which explains why the backgrounds are different).  
Another advantage of the image capture methodology in terms of formally indexing each image by zoom level, elevation \(h\) and horizontal distance \(d\), is that it opens the possibility of not just image classification (i.e., predicting the type of UAV in the image), but also elevation prediction and distance prediction. This topic is not covered in this paper, primarily because it would require a much larger dataset, but it is an interesting possibility for the future, particularly as such predictions may facilitate evidence that a UAV was flying illegally (e.g., too close to people).