# Real UAV-Bird Image Classification Using CNN with a Synthetic Dataset
## 3 Materials and Methods
### Corner Detection and Nearest Three-Point Selection Layer (CDNTS)  
The test accuracy results of the synthetic test and real test data of the networks trained with synthetic data were measured in experiment 1. As a result of experiment 1, the accuracy of the synthetic test data was acceptable, while the accuracy of the real test data did not exceed 60%. Therefore, studies were carried out to increase the test accuracy of real test data. As a result of our investigation, the usage of a layer named CDNTS has been proposed. Some studies in the literature have shown that the choice of method for the feature extraction of images may be a successful way to improve the performance of a CNN-based algorithm [45]. Simple and lower-dimensional RW-UAV images created from lines drawn between the corner points of the images could improve the performance of DL algorithms [46]. Therefore, a layer called the corner detection and nearest three-point selection (CDNTS) layer was added to the front of the CNN-based networks. This layer, designed for the input of CNN-based networks, is an algorithm that finds corner points in the images and connects the three closest corner points with lines. The \"good features to track\" library of the OPENCV framework was used to detect corners. The corner detector library was developed by [PERSON] with the authors in [38; 47]. Position data of corner points found by the corner detector were used to draw lines between the nearest three corner points. There are studies in the literature that draw continuing lines between points [48]. In our study, the continuity of the lines drawn between the points was ignored. \begin{table}
\begin{tabular}{c c} \hline \hline
**Hyperparameters** & **Values** \\ \hline Optimizers & Adam/Adadelta/RMSprop/SGD \\ Batch Size & 32/128/256 \\ Learning Rate & 0.1/0.01/0.001 \\ Dropout & 0.5/0.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The combinations of hyperparameters. A line was drawn between the three closest points to each point. Algorithm 2 was generated from CDNTS algorithms. The corner detection algorithm, which is a part of the CDNTS layer, was created using the OPENCV library. Another part of the CDNTS layer, the nearest three-point selection part, was coded by the authors. A general representation of the algorithm is shown in Algorithm 2. ```
image = Read image data from dataset; corners = Find corner using Opencv goodFeatureToTrack(image); foreach\(corner\in corners\)do foreach\(corner_{target}\in corners\)do\(vector_{\text{len}}=\sqrt{(corner_{\text{xPos}}-corner_{\text{targetXPos}})^{2}+(corner_{ \text{yPos}}-corner_{\text{targetYPos}})^{2}}\) ; \(min1 st,min2 nd,min3 th\gets 99999;;\) if\(vector_{\text{len}}\leq min1 st_{\text{vector}}\)then \(min3 th\gets min2 nd\); \(min2 nd\gets min1 st\); \(min1 st\gets vector_{\text{len}}\); elseif\(vector_{\text{len}}\leq min2 nd\)then \(min3 th\gets min2 nd\); \(min2 nd\gets vector_{\text{len}}\); elseif\(vector_{\text{len}}\leq min3 th_{\text{vector}}\)then \(min3 th\gets vector_{\text{len}}\);  end if DrawLine (from \(\text{corner}_{\text{targetXYPos}}\) to \(\text{min1 st_{XY Position}}\)) ; DrawLine (from \(\text{corner}_{\text{targetXYPos}}\) to \(\text{min2 nd_{XY Position}}\)) ; DrawLine (from \(\text{corner}_{\text{targetXYPos}}\) to \(\text{min3 th_{XY Position}}\)) ;  end for Corner detection and nearest three-point selection is completed. ```  
**Algorithm 2**Corner detection and nearest three-point selection layer. Algorithm 2 was used to find the corner points of the images and to draw a new image with lines between the three closest corner points. This new image consisting of only corners and lines was then given to the CNN-based network. Sample output images of Algorithm 2 are shown in Figure 6.  
Figure 6: Sample output images of the CDNTS algorithm.