An unmanned aerial vehicle small sample fault diagnosis system and method

By combining a Siamese hybrid neural network model and a feature encoder, the problem of UAV fault diagnosis under small sample fault data is solved, achieving high-precision and generalized fault diagnosis, and avoiding dependence on a large amount of labeled data.

CN115204302BActive Publication Date: 2026-06-02GUIZHOU UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUIZHOU UNIV
Filing Date
2022-07-22
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing deep learning models rely on large amounts of fault data and high-quality labels, making it difficult to effectively utilize small sample fault data from fixed-wing UAVs for intelligent fault diagnosis.

Method used

The Siamese Hybrid Neural Network (SHNN) model is adopted, which combines a 1D CNN-LSTM hybrid feature encoder and Manhattan distance calculation. By using the weight sharing mechanism of the Siamese network and the "state graph" strategy, the flight data is resampled, normalized and sample pairs are constructed to extract spatial and temporal feature information. The model is then optimized using a loss function.

Benefits of technology

It achieves high-precision fault diagnosis with small sample sizes, avoids dependence on a large number of labeled fault samples, improves the completeness of fault information and diagnostic accuracy, and has good cross-task generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115204302B_ABST
    Figure CN115204302B_ABST
Patent Text Reader

Abstract

This invention relates to the field of UAV fault diagnosis technology, and discloses a small-sample fault diagnosis system and method for UAVs, which proceeds according to the following steps: a. Fault data is acquired using a fixed-wing UAV flight test system, and a "state graph" strategy is used to sequentially resample, normalize, and construct training and test sample pairs for multivariate flight data; b. The training fault sample pairs are input into a 1D CNN-LSTM hybrid feature encoder to extract feature embeddings containing spatial and temporal information; c. The similarity between two feature embeddings is calculated using the weight sharing mechanism of Siamese networks and Manhattan distance; d. Batch sample pairs are randomly sampled, the model is trained and validated, and the optimal model is applied to perform an N-way K-shot test task to achieve small-sample fault classification. This invention achieves high fault diagnosis accuracy with limited training samples, strong cross-task generalization, and the ability to identify new types of faults, providing an intelligent solution for fixed-wing UAV fault diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of unmanned aerial vehicle (UAV) fault diagnosis technology, and specifically to a UAV small sample fault diagnosis system and method. Background Technology

[0002] As intelligent aircraft, drones are widely used in military, plant protection, and geographic surveying missions due to their advantages such as high maneuverability, mission versatility, and precise and efficient operation. Among them, fixed-wing drones can achieve low-energy consumption and long-endurance flight based on the passive lift generated by their wings. However, due to the lack of real-time decision-making capabilities, the complex system failure rate of fixed-wing drones is very high in harsh service environments. If failure to detect failures in time can lead to mission failure, aircraft crashes, and serious casualties and economic losses.

[0003] Traditional hardware redundancy methods offer high reliability but cannot meet the size, payload, and manufacturing cost requirements of drones. Meanwhile, model-based methods, such as filtering and adaptive control, rely on accurate physical models and expert experience. With the rise of artificial intelligence, deep learning's powerful automatic feature extraction and pattern recognition capabilities provide intelligent solutions for drone fault diagnosis.

[0004] However, most current deep learning diagnostic models are supervised learning models, whose performance depends on abundant fault data, fault types, and high-quality labels. Due to the high cost of acquiring fault samples for fixed-wing UAVs, the complex service environment, and the long-tail distribution of data, only a small number of fault samples can be obtained in actual flight. Therefore, current supervised deep learning models cannot achieve intelligent fault diagnosis for UAVs using a limited number of fault samples. Summary of the Invention

[0005] The present invention aims to provide a method for diagnosing drone faults using a small sample size, in order to solve the problem that current traditional deep learning models cannot complete drone fault diagnosis using a small sample size.

[0006] To solve the above problems, the present invention adopts the following technical solution:

[0007] A method for diagnosing small-sample faults in unmanned aerial vehicles (UAVs) includes the following steps:

[0008] Step 1: Construct a hybrid Siamese neural network by adding a 1D CNN-LSTM hybrid feature encoder to the Siamese neural network;

[0009] Step 2: Collect raw flight data, including UAV fault data, to form a flight dataset; using the "state diagram" sampling strategy, resample, normalize, and construct sample pairs in sequence on the flight dataset to obtain training fault sample pairs and test fault sample pairs.

[0010] Step 3: Input the training fault sample pairs into the hybrid feature encoder of 1D CNN-LSTM to extract feature embeddings containing spatial and temporal feature information;

[0011] Step 3: Calculate the similarity between two feature embeddings using the weight sharing mechanism of Siamese networks and Manhattan distance to obtain feature similarity;

[0012] Step 4: Convert feature similarity into [0,1] prediction probabilities using an activation function, and calculate the model loss value based on the prediction probabilities and sample labels using a loss function.

[0013] Step 5: Select a batch of sample pairs and repeat steps 2 to 4 until the calculated loss value is minimized. This completes the training of the twin hybrid neural model and forms the optimal model.

[0014] Step 6: Construct an N-way K-shot test task based on random sampling of test fault data. That is, each task randomly samples N types of faults, and provides K samples as support sets for each type of fault. The trained optimal model is used to classify the M samples in the query set of the test task.

[0015] The principle and advantages of this scheme are:

[0016] Compared with existing technologies, this invention addresses the performance degradation problem of traditional deep learning models caused by the limited number of drone fault samples. Based on the Siamese neural network, it creatively designs a Siamese Hybrid Neural Network (SHNN) model. By constructing and using this model, it is possible to effectively extract rich fault information to achieve intelligent fault diagnosis even with small sample sizes.

[0017] Furthermore, this invention employs a "state diagram" strategy to sequentially resample, normalize, and construct sample pairs for multivariate flight data, thereby achieving standardized preprocessing of flight data and selection of strongly correlated variables. This improves the quality of limited sample data and lays the foundation for accurate classification in diagnostic models.

[0018] This invention extracts rich fault features from fault sample pairs using a hybrid feature encoder based on a 1D CNN-LSTM. Compared to existing technologies that only utilize CNN or LSTM networks to obtain single spatial or temporal features, this approach significantly improves the completeness of fault information and reduces reliance on a large number of fault samples by simultaneously extracting hybrid features encompassing both time and space. The similarity of input sample pairs is measured by calculating the Manhattan distance (L1) between two feature embeddings in the metric space. Finally, random sampling of batches of samples, along with training and validation using a loss function optimizer, allows for rapid acquisition of the optimal model, reducing computational load while maintaining a certain level of accuracy. The optimal model is then applied to perform an N-way K-shot test task to achieve small-sample fault classification. This invention can automatically extract features directly from raw flight data, achieving end-to-end intelligent fault diagnosis and avoiding the dependence of traditional deep learning models on a large number of labeled fault samples.

[0019] This invention can adaptively extract rich spatial and temporal feature information from flight data. The twin network structure design can map fault samples from the input space to the metric space for similarity comparison, further improving the fault diagnosis accuracy under limited training samples.

[0020] Preferably, as an improvement, the "state diagram" sampling strategy is as follows:

[0021] Select state variables that are strongly correlated with faults from the flight dataset, and use a time window with a fixed window length VL to slide along the time axis without overlap to obtain a state graph containing the health status of the UAV and form multivariate state graph data; set a threshold of [-1,1] to perform Min-Max normalization on the multivariate state graph data; randomly sample the same number of samples from different types of fault data to construct the same / different sample pairs.

[0022] The above settings enable rapid and effective processing of raw flight data, improving the data quality of limited samples and providing a prerequisite for accurate feature extraction later.

[0023] Preferably, as an improvement, the fixed window VL of the time window is 20 steps, and the number of variables that are strongly correlated with the fault is 8.

[0024] The above settings optimize the time window size, enabling the rapid acquisition of valid state variables to form state diagram data while avoiding the inconvenience caused by excessive computation or too frequent sliding operations.

[0025] Preferably, as an improvement, the process of extracting spatial feature information through 1D CNN in the 1D CNN-LSTM hybrid feature encoder is as follows:

[0026] For a given sample pair The i-th spatial feature extracted from each layer using a 1D CNN is described by the following formula:

[0027]

[0028]

[0029] Among them, W l-1,l It is the weight tensor of this layer, h 1,l-1 ,h 2,l-1 It is a sample The hidden tensor at layer l, b l It is a bias term.

[0030] Through the above settings, the present invention can adaptively and accurately extract spatial feature information, providing necessary support for the accuracy of the optimal model.

[0031] Preferably, as an improvement, the process of extracting temporal feature information in the LSTM layer of the 1D CNN-LSTM hybrid feature encoder is as follows:

[0032] i t =g(W i h (t-1) +U i x (t) +b i ),

[0033] s t =f t es t-1 +i t e tanh(W s h (t-1) +U s x (t) +b s ),

[0034] f t =g(W f h (t-1) +U f x (t) +b f ),

[0035] p t =g(W p h (t-1) +U p x (t) +b p ),

[0036] h (t) =p t e tanh(s t ),

[0037] Where, x (t) Let i be the spatial feature input at time t. t s t f t p t and h (t) The functions are, in order, the input gate, state gate, forget gate, output gate function, and time feature information of the LSTM layer, where e represents element-wise multiplication.

[0038] Through the above settings, the present invention is able to further mine potential temporal features in flight data from the extracted spatial feature information, thereby improving the information completeness of limited samples.

[0039] Preferably, as an improvement, the process of calculating the similarity between the two feature embeddings in step three is as follows:

[0040]

[0041] and To obtain feature embedding pairs that contain spatial and temporal information, The Manhattan distance (L1) is calculated; the smaller the distance value, the more similar the input samples are.

[0042] By using the above methods, the Siamese hybrid neural network model can be trained quickly by calculating the similarity between two feature embeddings.

[0043] Preferably, as an improvement, the loss function is a binary cross-entropy loss function:

[0044]

[0045] Among them, utilizing The predicted probability value. This is a real label.

[0046] By using the binary cross-entropy loss function, the learning rate can be controlled by the output error, avoiding the problem of learning rate decline and optimizing model training.

[0047] Preferably, as an improvement, when training the twin hybrid neural model in step five, the Adam optimizer is used to backpropagate and update the model parameters, and the optimal model is found based on the validation set.

[0048] The Adam optimizer facilitates rapid model optimization, is simple to implement, computationally efficient, and requires minimal memory.

[0049] Preferably, as an improvement, the fault sample pair in step two is a state diagram pair, which includes a training data state diagram and a test data state diagram; the state diagram is a set of flight state matrices.

[0050] The above settings facilitate the effective use of the original flight dataset, making full use of all the effective information in the small sample.

[0051] The present invention also provides a small sample fault diagnosis system for unmanned aerial vehicles, including a central processing unit and an actual data acquisition module, a sample data acquisition module and a sample division module respectively connected thereto;

[0052] The central processing unit stores computer instructions corresponding to the small sample fault diagnosis method for unmanned aerial vehicles as described in claim 1.

[0053] The actual data acquisition module is used to acquire actual flight data, including actual fault data, generated by the actual flight of the UAV, and form test fault data.

[0054] The sample data acquisition module is used to acquire sample data for debugging and optimizing the small sample fault diagnosis method for UAVs.

[0055] The sample partitioning module is used to divide the sample data into multiple state diagrams through a time window according to the "state diagram" sampling strategy, forming multivariate state diagram data; set a threshold of [-1,1] to perform Min-Max normalization on the multivariate state diagram data; and randomly sample the same number of samples from different types of fault data to construct the same / different sample pairs.

[0056] The advantage of the UAV small-sample fault diagnosis system is that it can overcome the problem of collecting a large number of UAV labeled fault samples. Using only a limited number of fault samples, the system can quickly optimize the diagnosis method based on the aforementioned methods through the sample data acquisition module and the sample segmentation module. In this way, it can complete the diagnosis and classification of the test fault data acquired by the actual data acquisition module. Attached Figure Description

[0057] Figure 1 It is a fixed-wing unmanned aerial vehicle (UAV) flight test system;

[0058] Figure 2 This is a schematic diagram of the "state diagram" sampling strategy;

[0059] Figure 3 This is a performance comparison chart of binary classification fault diagnosis models based on limited training data;

[0060] Figure 4 This is a performance comparison chart of multi-class fault diagnosis models based on limited training data;

[0061] Figure 5 This is a feature visualization of the comparison model when the training samples are 90; where (a): 1D CNN; (b): LSTM; (c): CNLS; (d) SHNN;

[0062] Figure 6 This is a performance comparison chart of new types of fault identification based on limited training data;

[0063] Figure 7 This is a diagram of the twin hybrid neural network structure of the present invention. Detailed Implementation

[0064] The following detailed description illustrates the specific implementation method:

[0065] The purpose of this invention is to provide a small-sample fault diagnosis method for fixed-wing UAVs based on a Siamese hybrid neural network. This invention trains the model using only a limited number of samples, commonly referred to as a small sample size. The resulting model exhibits high fault diagnosis accuracy, strong cross-task generalization, and the ability to identify novel types of faults, providing an intelligent solution for fixed-wing UAV fault diagnosis.

[0066] The method for diagnosing small-sample faults in unmanned aerial vehicles (UAVs) according to the present invention is performed according to the following steps:

[0067] a. Use a fixed-wing UAV flight test system to obtain fault data, and apply the "state diagram" strategy to resample, normalize, and construct sample pairs for the multivariate flight data of the fixed-wing UAV in sequence;

[0068] b. Input the faulty sample pairs into the hybrid feature encoder of 1D CNN-LSTM to extract feature embeddings containing spatial and temporal information;

[0069] c. Utilize the weight-sharing mechanism of Siamese networks and Manhattan distance to calculate the similarity between two feature embeddings;

[0070] d. Randomly sample batches of sample pairs, train and validate the model, and apply the optimal model to perform an N-way K-shot test task to achieve small-sample fault classification.

[0071] In step a, the application of the "state diagram" strategy to process flight data is as follows:

[0072] Variables with strong correlation to faults are selected from multivariate flight data. A state map containing the health status of fixed-wing UAVs is obtained by sliding a fixed window length VL along the time axis without overlap using a time window. A threshold of [-1,1] is set to perform Min-Max normalization on the multivariate state map data. The same number of samples are randomly sampled from different types of fault data to construct identical / different sample pairs, which are used as inputs to the Siamese hybrid network.

[0073] In step b, the spatial feature information extracted by the 1D CNN in the 1D CNN-LSTM hybrid feature encoder is as follows:

[0074] For a given sample pair The i-th spatial feature extracted from each layer using a 1D CNN is described by the following formula:

[0075]

[0076]

[0077] Among them, W l-1,l It is the weight tensor of this layer, h 1,l-1 ,h 2,l-1 It is a sample The hidden tensor at layer l, b l It is a bias term.

[0078] In step b, the temporal feature information extracted from the LSTM layer of the 1D CNN-LSTM hybrid feature encoder is as follows:

[0079] i t =g(W i h (t-1) +U i x (t) +b i (3)

[0080] s t =f t es t-1 +i t e tanh(W s h (t-1) +U s x (t) +b s (4)

[0081] f t =g(W f h (t-1) +U f x (t) +b f ), (5)

[0082] p t =g(W p h (t-1) +U p x (t) +b p ), (6)

[0083] h (t) =pt e tanh(s t (7)

[0084] Where, x (t) Let i be the spatial feature input at time t. t s t f t p t and h (t) The functions are, in order, the input gate, state gate, forget gate, output gate function, and time feature information of the LSTM layer, where e represents element-wise multiplication.

[0085] In step c, the similarity measurement is as follows:

[0086]

[0087] and To obtain feature embedding pairs that contain spatial and temporal information, The Manhattan distance (L1) is calculated; the smaller the distance value, the more similar the input samples are.

[0088] In step d, the model training process is as follows:

[0089] Based on the flight data processed using the "state diagram" strategy, the training set D is divided. train Validation set D val and test set D test D = {D} train D val D test}; using training set D train Training the model.

[0090] In this invention, the loss function used is the binary cross-entropy loss function:

[0091]

[0092] Among them, utilizing The predicted probability value. This is a real label.

[0093] In step d, the model parameters are updated using backpropagation with the Adam optimizer, and the optimal model is found based on the validation set.

[0094] Using the optimal model, an N-way K-shot fault classification task is constructed during the testing process. N types of faults are randomly sampled, and K samples from each type are selected as support sets. The fault samples in the query set are then classified to complete the fault diagnosis.

[0095] In this invention, the training set, validation set, test set, support set, and query set refer to the training sample set used for sample training, the validation sample set used for model validation, the test sample set used for model testing, the support sample set used for optimal model validation support, and the query data set formed by actual fault data to be used for diagnostic queries.

[0096] Compared with existing technologies, this invention addresses the performance degradation of traditional deep learning models caused by the limited number of fault samples in fixed-wing UAVs. It designs a small-sample fault diagnosis method for fixed-wing UAVs based on a Siamese Hybrid Neural Network (SHNN): First, a "state graph" strategy is used to resample, normalize, and construct sample pairs from multivariate flight data sequentially. Then, fault sample pairs are input into a 1D CNN-LSTM hybrid feature encoder to extract fault features. The similarity of input sample pairs is measured by calculating the Manhattan distance (L1) between two feature embeddings in the metric space. Finally, a batch of samples is randomly sampled, and the optimal model is obtained through training and validation using binary cross-entropy loss and the Adam optimizer. The optimal model is then applied to perform an N-way K-shot test task to achieve small-sample fault classification. This method can automatically extract features directly from the raw flight data, achieving "end-to-end" intelligent fault diagnosis and avoiding the dependence of traditional deep learning models on a large number of labeled fault samples.

[0097] Although there are some existing technologies for drone fault detection, they differ greatly from the research approach of this solution.

[0098] For example: Document "Cui, A., Zhang, Y., Zhang, P., Dong, W., & Wang, C. (2020). Intelligent health management of fixed-wing UAVs: A deep-learning-based approach. 2020 16 thThe International Conference on Control, Automation, Robotics and Vision (ICARCV), 1055–1060, records the implementation of real-time fault prediction for fixed-wing UAVs using LSTM networks. The paper "Guo, D., Zhong, M., Ji, H., Liu, Y., & Yang, R. (2018). A hybrid feature model and deep learning-based fault diagnosis for unmanned aerial vehicle sensors. Neurocomputing, 319, 155–163." records the conversion of residual signals into video images and the extraction of features using CNN networks to achieve fault diagnosis for UAV sensors. The paper "Ahmad, MW, Akram, MU, Ahmad, R., Hameed, K., & Hassan, A. (2022). Intelligent framework for automated failure prediction, detection, and classification of mission-critical autonomous flights. ISA Transactions, S0019057822000209." proposes an integrated framework for fixed-wing UAV fault prediction, detection, and classification based on LSTM.

[0099] While the three aforementioned papers have made significant strides in the field of UAV fault diagnosis and achieved some results, their descriptions and solutions, like most current deep learning diagnostic models, are all based on supervised learning. More importantly, to improve their accuracy, they heavily rely on abundant fault data, fault types, and high-quality labels. This invention, however, breaks through the current bottleneck of high dependence on sample quantity and quality in UAV fault diagnosis.

[0100] This invention can adaptively extract rich spatial and temporal feature information from flight data. The twin network structure design can map fault samples from the input space to the metric space for similarity comparison, further improving the fault diagnosis accuracy under limited training samples.

[0101] To verify the effectiveness and generalizability of this invention, the following experiments were conducted using a small fixed-wing UAV flight dataset:

[0102] Experimental Example

[0103] 1.1 Data Source

[0104] Experimental setup such as Figure 1 As shown in Table 1, the fixed-wing UAV flight test system mainly consists of three parts: the UAV airframe, the ground control station, and the RC transmitter, using the existing Paparazzi flight control system. In the experiment, various runaway failures of the UAV actuators were simulated by modifying the commands of the ground control station and the airborne controller. Flight data for different days in July 2020 were recorded. The verification experiment of this invention used flight data from July 12th, 13th, 21st, and 23rd. The flight data from the 12th and 13th included two states: normal and right control surface runaway failure (30% control efficiency); the flight data from the 21st and 23rd included two states: normal, right control surface runaway failure, and left control surface runaway failure (90%–30% control efficiency). The selected flight parameters included linear acceleration (α). x ,a y ,a z ), angular velocity (w) x ,w y ,w z ) and left and right control plane commands (u c1 ,u c2 The specific sample dataset is shown in Table 2.

[0105] Table 1 Specifications of Fixed-Wing Unmanned Aerial Vehicle Flight Test System

[0106]

[0107] Table 2 Sample Dataset

[0108]

[0109]

[0110] 1.2 Parameter Selection

[0111] The sampling strategy uses a "state diagram" approach with a time window length of 20 steps, such as... Figure 2 As shown in Table 3, the optimal 1D CNN-LSTM model was determined through multiple experiments during the construction of the Siamese hybrid neural network. The network parameters are shown in Table 3. Simultaneously, the training batch size was set to 64, the learning rate of the Adam optimizer was 0.0006, and an early stopping mechanism was introduced to prevent overfitting.

[0112] Table 3 Structural parameters of twin hybrid networks

[0113]

[0114] 1.3 Results Analysis

[0115] To verify the effectiveness and generalization of this invention, it was compared with machine learning models such as Support Vector Machine (SVM), deep learning models such as One-Dimensional Convolutional Neural Network (1D CNN), Long Short-Term Memory Network (LSTM), a hybrid model of one-dimensional convolutional neural network and long short-term memory network (CNLS), and few-shot learning models such as Siamese Convolutional Network (SCNN) and Siamese Long Short-Term Memory Network (SLS) under the same experimental conditions. To avoid the randomness of the experimental results, each experiment was performed 5 times and the average value was taken.

[0116] 1.3.1 Performance of binary classification fault diagnosis based on limited training data

[0117] The comparison results of the model on the binary classification fault diagnosis task are as follows: Figure 3 As shown, from Figure 3 It can be seen that, compared with the traditional machine learning model SVM, the fault diagnosis accuracy of this invention is 10.95% higher when the training sample size is 45. This is because SVM cannot effectively extract fault features from limited flight data. Compared with deep learning models, the recognition rate of this invention is 4%-5% higher than 1D CNN, LSTM, and CNLS. This is because traditional 1D CNN focuses on the extraction of local features, LSTM only focuses on temporal features, and CNLS lacks the ability to measure the similarity of samples. SCNN and SLS have a Siamese learning mechanism, but they can only extract spatial or temporal features, and their performance is still lower than that of this invention. Therefore, this invention utilizes a Siamese hybrid structure design, which can simultaneously extract spatial and temporal feature information from limited data and use the weight sharing mechanism of the Siamese network to measure the distance between sample pairs to achieve accurate fault diagnosis.

[0118] 1.3.2 Performance of Multi-Class Fault Diagnosis Based on Limited Training Data

[0119] To further demonstrate the effectiveness of this invention in identifying multiple types of faults, a model comparison was conducted on dataset F in Table 2. This dataset contains flight data from the 21st and 23rd, including nine types of actuator failure faults. The experimental results are as follows: Figure 4 As shown. From Figure 4 As can be seen, the performance of all models is approximately 40% lower than that in binary classification tasks, indicating that multi-class fault diagnosis is more complex. However, the overall performance of this invention is higher than that of the comparison models. With 45 training samples, 1DCNN can only achieve 28.13%, which is 9.83% lower than the accuracy of this invention. This is because, with limited samples, deep learning-based models are prone to overfitting, resulting in poor fault classification performance on test samples.

[0120] To further demonstrate the feature learning capability of the SHNN model of this invention, the feature embeddings of the final fully connected layer of each comparative model under 90 training samples are visualized using the existing T-SNE method, such as... Figure 5 As shown in the figure, the SHNN model of the present invention can better distinguish different faults and aggregate similar faults during the test, proving the effectiveness of its feature extraction and classification.

[0121] 1.3.3 Performance of Novel Fault Identification Based on Limited Training Data

[0122] To further verify the ability of the SHNN model of this invention to identify new types of faults, the model was trained on (9-N) types of fault samples based on the F dataset and tested on N (N=1,2,3) types of new fault samples. The experimental results are as follows. Figure 6 As shown. From Figure 6 As can be seen, the SHNN model of this invention can identify fault types not seen in the training phase during the testing phase, and the recognition rate reaches about 40% in the identification of two and one new fault types, which can exceed the accuracy of the comparative model when all faults are known.

[0123] In summary, this invention directly utilizes raw flight data as model input, adaptively extracts spatial and temporal features from the flight data through a hybrid 1D CNN and LSTM network, and uses a Siamese network structure for sample similarity measurement, achieving end-to-end fixed-wing UAV actuator fault diagnosis. Experiments show that, compared with traditional machine learning models, deep learning models, and few-shot learning models, this invention avoids dependence on a large number of labeled fault samples, achieves a high recognition rate with a limited number of fault samples, and has good generalization ability for novel fault types.

[0124] Example 1

[0125] Example 1 is basically as shown in the appendix. Figure 7 As shown:

[0126] The small-sample fault diagnosis method for fixed-wing UAVs based on twin hybrid neural networks in this embodiment is performed according to the following steps:

[0127] Step S1: Construct a twin hybrid neural network by adding a 1D CNN-LSTM hybrid feature encoder to the twin neural network.

[0128] Step S2, using as follows Figure 1The fixed-wing UAV flight test system shown simulates various uncontrollable malfunctions of the UAV by modifying the commands of the onboard controllers on the ground station and the UAV through the data link between the ground station and the UAV and the control link established between the RC transmitter and the UAV, and collects the flight data of the UAV in real time. The system also collects the flight data through a laptop connected to the ground station to form a multivariate flight data set including the original fault data.

[0129] Step S3, apply as follows Figure 2 The "state graph" sampling strategy shown sequentially resamples, normalizes, and constructs sample pairs for the multivariate flight data of fixed-wing UAVs, thereby obtaining sample data and state graph pairs. Each sample data and state graph pair includes a training dataset and a test dataset, and each state graph pair includes a state graph of the training data and a state graph of the test data. The state graph is a set of matrices formed according to a time window.

[0130] The application of the "state diagram" sampling strategy to process flight data is as follows:

[0131] Variables with a strong correlation to the fault were selected from multivariate flight data, including eight variables: linear acceleration (α). x ,a y ,a z ), angular velocity (w) x ,w y ,w z ) and left and right control plane commands (u c1 ,u c2 The system utilizes a time window with a fixed window length VL that slides non-overlapping along the time axis to obtain a state map containing the health status of the fixed-wing UAV. In this embodiment, VL is 20 steps. This time window can collect enough sample data for model calculation and complete sampling in a limited number of slides, reducing the amount of computation.

[0132] A threshold of [-1, 1] is set to perform Min-Max normalization on the multivariate state graph data. The same number of samples are randomly sampled from different types of fault data to construct identical / different fault sample pairs, which serve as input to the Siamese hybrid network. In this embodiment, the number of sample pairs is between 45 and 3600 to simulate the performance of the diagnostic model under both limited and sufficient data conditions. Compared to traditional deep learning models that require a large number of fault samples, this scheme not only achieves higher diagnostic accuracy with limited fault samples but also demonstrates considerable diagnostic performance with sufficient data.

[0133] The multivariate flight data of a fixed-wing UAV refers to the collection of flight data corresponding to various states formed by a fixed-wing UAV under multiple variable conditions. While this invention is primarily applied to fixed-wing UAVs, it is also applicable to other types of UAVs.

[0134] Step S4: Input the fault sample pairs into the hybrid feature encoder of 1D CNN-LSTM to extract feature embeddings containing spatial and temporal feature information. Compared with the existing technology, this scheme can greatly improve the completeness of fault information and reduce the dependence on a large number of fault samples by simultaneously extracting hybrid features containing time and space.

[0135] The spatial feature information extracted by 1D CNN in the 1D CNN-LSTM hybrid feature encoder is as follows:

[0136] For a given sample pair The i-th spatial feature extracted from each layer using a 1D CNN is described by the following formula:

[0137]

[0138]

[0139] Among them, W l-1,l It is the weight tensor of this layer, h 1,l-1 ,h 2,l-1 It is a sample The hidden tensor at layer l, b l It is a bias term.

[0140] Specifically, the temporal feature information extracted from the LSTM layer of the 1D CNN-LSTM hybrid feature encoder is as follows:

[0141] i t =g(W i h (t-1) +U i x (t) +b i (3)

[0142] s t =f t es t-1 +i t e tanh(W s h (t-1) +U s x (t) +b s (4)

[0143] f t =g(W fh (t-1) +U f x (t) +b f ), (5)

[0144] p t =g(W p h (t-1) +U p x (t) +b p ), (6)

[0145] h (t) =p t e tanh(s t (7)

[0146] Where, x (t) Let i be the spatial feature input at time t. t s t f t p t and h (t) The functions are, in order, the input gate, state gate, forget gate, output gate function, and time feature information of the LSTM layer, where e represents element-wise multiplication.

[0147] Step S5: Calculate the similarity between two feature embeddings using the weight sharing mechanism of Siamese networks and Manhattan distance.

[0148] Specifically, the similarity measurement is as follows:

[0149]

[0150] and To obtain feature embedding pairs that contain spatial and temporal information, The Manhattan distance (L1) is calculated; the smaller the distance value, the more similar the input samples are.

[0151] Step 6: Divide the flight data processed based on the "state diagram" strategy into training, validation, and test sets, D = {D} train D val D test}; Train the model using the training set. Substitute the training set into the similarity metric calculation formula (8) to calculate the feature similarity; convert the feature similarity into [0,1] prediction probabilities through the activation function, and calculate the model loss value based on the prediction probabilities and sample labels using the loss function; the loss function is the binary cross-entropy loss function:

[0152]

[0153] Among them, utilizing The predicted probability value. This is a real label.

[0154] Step 7: Randomly sample batch of sample pairs. In this embodiment, the number of batch sample pairs is 64. That is, each time, 64 sample pairs are used to repeat steps 2 to 6 until the calculated loss value is minimized, thus completing the training of the Siamese hybrid neural model. At the same time, the Adam optimizer is used to backpropagate and update the model parameters to form the optimal model. In this embodiment, the learning rate of the Adam optimizer is 0.0006, which can quickly complete the learning and find the optimal model. At the same time, an early stopping mechanism is introduced to prevent overfitting.

[0155] Step 8: After obtaining the optimal model, construct an N-way K-shot test task based on random sampling of test fault data. That is, each task randomly samples N types of faults, and provides K samples as support sets for each type of fault. Use the trained optimal model to classify the M samples in the query set of the test task to achieve accurate fault diagnosis.

[0156] Specifically, test fault data is obtained through actual collection during the test. During the test, an N-way K-shot fault classification task is constructed, randomly sampling N types of faults and selecting K samples from each as support sets to classify the fault samples in the query set.

[0157] The aforementioned 1D CNN refers to a one-dimensional convolutional neural network (CNN). CNNs are a typical type of artificial neural network that uses convolutional operations to adaptively filter information from input data to generate feature maps. In 1D CNNs, the convolutional kernels move along one dimension, and they are widely used in fields such as speech recognition, electroencephalography (EEG), and fault diagnosis. 1D CNNs typically include convolutional layers, non-linear activation layers, pooling layers, and fully connected layers, such as... Figure 7 As shown in the diagram, the convolutional layer filters the input data; the nonlinear activation layer improves the model's expressive power by using nonlinear functions; the pooling layer reduces model parameters through downsampling; and the fully connected layer, combined with the activation function, achieves the final classification.

[0158] The aforementioned LSTM stands for Long Short-Term Memory Network. LSTM is a variant of Recurrent Neural Network (RNN) designed to address the gradient explosion problem in traditional RNN training. A typical LSTM unit includes an input gate, a forget gate, a state gate, and an output gate, using gating mechanisms to add or remove useful information from the signal.

[0159] The aforementioned Siamese network is a metric-based few-shot learning model consisting of two identical models running in parallel. It uses sample pairs as input and maps the samples to a metric space through weight sharing to measure the similarity between sample pairs. Siamese networks follow an "N-way K-shot" testing method, where "N-way" means each test task contains N types of faults, and "K-shot" means that K samples are provided for each type of fault.

[0160] The fault diagnosis method of the present invention, namely the method for constructing and using a twin hybrid neural network model, is as follows: Figure 7 As shown, the Siamese hybrid neural network model mainly consists of two parts: a 1D CNN in the hybrid feature encoder extracts spatial features, and an LSTM extracts temporal relationships from the signal; the Siamese network structure measures the similarity of input sample pairs. The process can be described as follows: First, a "state graph" strategy is used to resample, normalize, and construct sample pairs for the multivariate flight data of the fixed-wing UAV; then, fault sample pairs are input into the 1D CNN-LSTM hybrid feature encoder to obtain fault features containing both spatial and temporal information; second, the Manhattan distance function of the Siamese network is used to measure the similarity of the input sample pairs; finally, the model is trained, validated, and applied to perform an N-way K-shot test task to achieve fault classification with small sample sizes.

[0161] Example 2

[0162] Based on Embodiment 1, this embodiment provides a small-sample fault diagnosis system for unmanned aerial vehicles, including a central processing unit and an actual data acquisition module, a sample data acquisition module, and a sample segmentation module connected thereto respectively.

[0163] The central processing unit stores computer instructions corresponding to the aforementioned small-sample fault diagnosis method for unmanned aerial vehicles.

[0164] The actual data acquisition module is used to acquire actual flight data, including actual fault data, generated by the actual flight of the UAV, and form test fault data.

[0165] The sample data acquisition module is used to acquire sample data for debugging and optimizing the small sample fault diagnosis method for UAVs. The sample data includes sample fault pairs.

[0166] The sample partitioning module is used to divide the sample data into multiple state diagrams through a time window according to the "state diagram" sampling strategy, forming multivariate state diagram data. Generally, two state diagrams form a sample fault pair. A threshold of [-1,1] is set to perform Min-Max normalization on the multivariate state diagram data. The same number of samples are randomly sampled from different types of fault data to construct the same / different sample pairs.

[0167] In this embodiment, the central processing unit, actual data acquisition module, sample data acquisition module, and sample division module are all integrated modules with corresponding data storage and calculation capabilities. They can be single components or devices with this function, or integrated circuit boards formed by connecting multiple electronic components. These hardware components can be purchased directly from the market and will not be described in detail here.

[0168] The advantage of the UAV small-sample fault diagnosis system is that it can overcome the problem of collecting a large number of UAV labeled fault samples. Using only a limited number of fault samples, the system can quickly optimize the diagnosis method based on the aforementioned methods through the sample data acquisition module and the sample segmentation module. In this way, it can complete the diagnosis and classification of the test fault data acquired by the actual data acquisition module.

[0169] The above descriptions are merely embodiments of the present invention, and common knowledge such as specific technical solutions and / or characteristics are not described in detail here. It should be noted that those skilled in the art can make various modifications and improvements without departing from the technical solutions of the present invention, and these should also be considered within the scope of protection of the present invention. These modifications and improvements will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.

Claims

1. A method for diagnosing small-sample faults in unmanned aerial vehicles (UAVs), characterized in that, Includes the following steps: Step 1: Construct a hybrid Siamese neural network by adding a 1D CNN-LSTM hybrid feature encoder to the Siamese neural network; Step 2: Collect raw flight data, including UAV fault data, to form a flight dataset; using the "state diagram" sampling strategy, resample, normalize, and construct sample pairs in sequence on the flight dataset to obtain training fault sample pairs and test fault sample pairs. Step 3: Input the training fault sample pairs into the hybrid feature encoder of 1D CNN-LSTM to extract feature embeddings containing spatial and temporal feature information; Step 3: Calculate the similarity between two feature embeddings using the weight sharing mechanism of Siamese networks and Manhattan distance to obtain feature similarity; Step 4: Convert feature similarity into [0,1] prediction probabilities using an activation function, and calculate the model loss value based on the prediction probabilities and sample labels using a loss function. Step 5: Select a batch of sample pairs and repeat steps 2 to 4 until the calculated loss value is minimized. This completes the training of the twin hybrid neural model and forms the optimal model. Step 6: Construct based on random sampling of test fault data N -way K -shot test task, that is, random sampling for each task N Fault types, each fault type provides K Using 10 samples as the support set, the trained optimal model is used to analyze the query set in the test task. M Each sample is used for fault classification.

2. The method for diagnosing small-sample faults in unmanned aerial vehicles according to claim 1, characterized in that, The "state diagram" sampling strategy is as follows: Select state variables that are strongly correlated with faults from the flight dataset, and use a time window with a fixed window length. Slide along the time axis without overlap to obtain a state graph containing the health status of the UAV and form multivariate state graph data; set a threshold of [-1,1] to perform Min-Max normalization on the multivariate state graph data; randomly sample the same number of samples from different types of fault data to construct identical / different sample pairs.

3. The method for diagnosing small-sample faults in unmanned aerial vehicles according to claim 2, characterized in that, The fixed window length of the time window The process consists of 20 steps, and the number of state variables that are strongly correlated with the fault is 8.

4. The method for diagnosing small-sample faults in unmanned aerial vehicles according to claim 1, characterized in that, The process of extracting spatial feature information through 1D CNN in the 1D CNN-LSTM hybrid feature encoder is as follows: For a given sample pair , Using 1D CNN to extract the first layer of each layer i Each spatial feature is described by the following formula: in, It is the weight tensor of this layer. , It is a sample , In the l Hidden tensors of the layer It is a bias term.

5. The method for diagnosing small-sample faults in unmanned aerial vehicles according to claim 1, characterized in that, The process of extracting temporal feature information in the LSTM layer of the 1D CNN-LSTM hybrid feature encoder is as follows: in, for t Spatial feature input at time, , , , and The components of an LSTM layer, in order, are the input gate, state gate, forget gate, output gate function, and temporal feature information. This indicates element-wise multiplication.

6. The method for diagnosing small-sample faults in unmanned aerial vehicles according to claim 1, characterized in that In step three, the process of calculating the similarity between the two feature embeddings is as follows: and To obtain feature embedding pairs that contain spatial and temporal information, The Manhattan distance (L1) is calculated; the smaller the distance value, the more similar the input samples are.

7. The method for diagnosing small-sample faults in unmanned aerial vehicles according to claim 1, characterized in that, The loss function is the binary cross-entropy loss function: Among them, utilizing The predicted probability value. This is a real label.

8. The method for diagnosing small-sample faults in unmanned aerial vehicles according to claim 1, characterized in that, In step five, when training the twin hybrid neural model, the Adam optimizer is used to backpropagate and update the model parameters, and the optimal model is found based on the validation set.

9. The method for diagnosing small-sample faults in unmanned aerial vehicles according to claim 1, characterized in that, The fault sample pairs in step two are state diagram pairs, which include training data state diagrams and test data state diagrams; the state diagrams are sets of flight state matrices.

10. A small-sample fault diagnosis system for unmanned aerial vehicles (UAVs), characterized in that, It includes a central processing unit and, respectively, a data acquisition module, a sample data acquisition module, and a sample partitioning module connected to it; The central processing unit stores computer instructions corresponding to the small sample fault diagnosis method for unmanned aerial vehicles as described in claim 1. The actual data acquisition module is used to acquire actual flight data, including actual fault data, generated by the actual flight of the UAV, and form test fault data. The sample data acquisition module is used to acquire sample data for debugging and optimizing the small sample fault diagnosis method for UAVs. The sample partitioning module is used to divide the sample data into multiple state diagrams through a time window according to the "state diagram" sampling strategy to form multivariate state diagram data; set a threshold of [-1,1] to perform Min-Max normalization on the multivariate state diagram data; and randomly sample the same number of samples from different types of fault data to construct the same / different sample pairs.