# Acquisition and Processing of UAV Fault Data Based on Time Line Modeling Method
## 5 Experimentation
### Performance on Machine Learning Algorithm  
From Figure 19, it can be seen that the Random Forest algorithm achieved a high accuracy rate of 84.0851% when using GPS information as data for training. The tree algorithm was influenced by the key features, and the changes in several of its features were obvious when the UAV fails, so the tree algorithm had a higher accuracy rate. The  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Data Sets** & **Accuracy Using KNN Algorithm (\%)** \\ \hline UAV ATTACK & 47.76 \\ ECU-IoT & 21.42 \\ TLM(Ours) & 70.65 \\ \hline \hline \end{tabular}
\end{table}
Table 10: Accuracy of using KNN algorithm on different data sets.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Data Sets** & **Year** & \begin{tabular}{c} **Number of** \\ **Features** \\ \end{tabular} & \
\begin{tabular}{c} **Abnormal** \\ **Number** \\ \end{tabular} &
\begin{tabular}{c} **The Proportion of** \\ **Abnormal Samples (\%)** \\ \end{tabular} & **Labelled** \\ \hline UAV ATTACK [21] & 2021 & 1110 & 2 & 2.2 & No \\ ECU-IoT [15] & 2022 & 10 & 3 & 39.0 & Yes \\ TLM(Ours) & 2023 & 821 & 4 & 54.3 & Yes \\ \hline \hline \end{tabular}
\end{table}
Table 9: Comparison of different UAV anomaly detection data sets.  
worst performing algorithm was the ZeroR, with an accuracy of 47.8966%. ZeroR is a simple classifier that selects a category with the highest probability as the classification result of an unknown sample. The performance of the other algorithms was concentrated between 50% and 70%, and better classification algorithms are needed to classify this data set so as to accurately identify the normal and abnormal states of drones by analyzing information from multiple aspects.  
The results of the evaluation of the data set using other classification metrics are shown in Table 9; the highest accuracy rate is indicated by bolded text. As seen from the table, the accuracy of the tree algorithm was generally higher than that of the others. The algorithm for tree categories relies on just a few features. However, it is often incorrect to judge  
Figure 19: Experimental Results.  
abnormal or normal based on a certain characteristic in real situations. For example, in the event of a battery failure in a UAV, there will be a sudden increase in discharge during a certain period. However, imagine the following scenario, in which the UAV encounters strong wind resistance, the UAV will increase its speed to prevent the mission path from deviating, and the battery will increase its discharge to keep the engine running normally, but the UAV does not have a battery failure at this time.  
In addition, as shown in Table 11, the accuracy of SMO, AdaBoost, and ZeroR algorithms is NaN because the denominator is 0 in the calculation of Precision. According to the formula of Precision, i.e., TP + FP is 0, which means that none of the samples were correctly classified. That also indicates that the classification of this data set is complex, and traditional machine learning algorithms cannot accurately classify faults.  
As shown in Tables 12 and 13, the random forest algorithm and the Naive Bayesian algorithm are selected in this paper, and the classification effect was evaluated using a confusion matrix, from which it can be seen that the classification of the accelerometer faults was the most difficult. In the Naive Bayesian and the random forest algorithm, 288 and 122 normal data were incorrectly classified as accelerometer faults, respectively.