## 2 Materials and Methods
### Diagnosis Model Based on Modified CNN  
As a well-known deep learning method, CNN (Convolutional Neural Network) has been widely utilized in various pattern recognition areas such as medical image analysis [33], crop mapping [34], text classification [35], fraud identification [36], voice recognition [37], and so on. CNN has already been used for the sensor faults diagnosis of UAV [38], rotating machinery [19] and the multi-operation forging process [39]. A typical CNN structure in classification, as presented in Figure 3, generally includes a feature extractor with one input layer and multiple convolutional and pooling layers, along with a classifier with several fully connected layers [40].  
Because the number of variables of the flight data of UAV input may not be decomposable directly, a variables preselection mechanism needs to be added. We used F-value in ANOVA (analysis of variance) as the standard, to eliminate the least important variables, and minimize the loss of data information in preselection.  
After preselection, five convolution layers were employed in our modified CNN-based model. The convolution layers, as the key to extract features, use the convolution operator to convert input data into a new feature map (output). For an input **X**, the feature map \(p\) of layer \(t\) in CNN can be calculated as  
\[\textbf{X}_{p,t}=F\left(\sum_{q=1}^{Q}\textbf{X}_{q,t-1}^{*}\omega_{p,q,t}+B_ {p,t}\right) \tag{4}\]  
where \(\textbf{X}_{q,t-1}\) is the feature map \(q\) of layer \((t-1)\); operator \(*\) is the convolution operation; \(\omega_{p,q,t}\) is the weights of layer \(t\); \(B_{p,t}\) is the bias of layer \(t\); and \(F\) is a non-linear activation function. Sigmoid, ELU, ReLU, Maxout and tanh are the commonly used activation functions in the CNN model. We chose the tanh function as the activation function in our diagnosis method after the consideration of the actual data, and having ReLU failure.  
Pooling layers, which are usually added after the convolutional layer to further fuse the features as a crucial role, were abandoned in our modified CNN model owing to neither the max-pooling or average-pooling producing significant results. Pooling may lead to the  
Figure 3: The basic structure of the Convolutional Neural Network (CNN) model.  
increase in error rate, meaning that pooling can be replaced by a higher strides setting and a flatten layer in CNN [41]. We set the strides of the convolution kernel as two, in the third of five convolution layers, to replace the acceleration effort of the pooling layer.  
A batch normalization layer was employed before fully connected layers to improve the robustness and accelerate model training, which could be calculated by:  
\[\mathbf{Y}_{p,t}^{m}=\gamma_{p,t}\cdot\frac{\mathbf{X}_{p,t-1}^{m}-\mu_{\delta} }{\sqrt{\sigma_{\delta}^{2}+c}}+\delta_{p,t} \tag{5}\]  
where \(\mathbf{Y}_{p,t}^{m}\) and \(\mathbf{X}_{p,t-1}^{m}\) are the output and input of the batch normalization layer; \(\mu_{\delta}\) and \(\sigma_{\delta}\) are the mean and variance of \(\mathbf{X}_{p,t-1}^{m}\); \(\gamma_{p,t}\) and \(\delta_{p,t}\) are the parameters to be learned; and \(c\) is a constant. A flatten layer was also employed there to make the high-dimensional output from the batch normalization layer into a one-dimensional input of the fully connected layer.  
Then, in the classifier, three fully connected layers were used to execute the diagnosis process here. The Softmax function and the Cross Entropy were used as an activation function and loss function in fully connected layers, respectively, to deal with the multi-class classification of mutually exclusive compound faults after labeling.  
Using a modified CNN-based fault diagnosis model would solve the obvious defects of FCNN properly, such as the information loss of large-scale data, the difficulty of high-dimensional data training and overfitting, having shown a great performance improvement in actual experiments.